@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,37 @@
|
|
|
1
|
+
import { createTheme } from '@shopify/restyle';
|
|
2
|
+
import { CustomLightTheme } from './theme';
|
|
3
|
+
import { typescale } from './tokens';
|
|
4
|
+
import type { MD3Theme } from 'react-native-paper';
|
|
5
|
+
|
|
6
|
+
const units: Record<string, number> = {};
|
|
7
|
+
|
|
8
|
+
new Array(1000).fill(0).forEach((_, index) => {
|
|
9
|
+
units[index + ''] = index;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const generateRestyleComponentsTheme = ({
|
|
13
|
+
theme,
|
|
14
|
+
}: {
|
|
15
|
+
theme: MD3Theme;
|
|
16
|
+
}) => {
|
|
17
|
+
// Restyle does not support elevation color as object
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
let { elevation, ...colors } = { ...theme.colors };
|
|
20
|
+
return createTheme({
|
|
21
|
+
colors: {
|
|
22
|
+
transparent: 'transparent',
|
|
23
|
+
...colors,
|
|
24
|
+
},
|
|
25
|
+
textVariants: typescale,
|
|
26
|
+
spacing: units,
|
|
27
|
+
breakpoints: {
|
|
28
|
+
phone: 0,
|
|
29
|
+
},
|
|
30
|
+
zIndices: units,
|
|
31
|
+
borderRadii: units,
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const dummyTheme = generateRestyleComponentsTheme({
|
|
35
|
+
theme: CustomLightTheme as MD3Theme,
|
|
36
|
+
});
|
|
37
|
+
export type ThemeType = typeof dummyTheme;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import color from 'color';
|
|
2
|
+
import { MD3Colors, tokens, typescale } from './tokens';
|
|
3
|
+
import type { MD3Theme } from 'react-native-paper';
|
|
4
|
+
const { palette, opacity } = tokens.md.ref;
|
|
5
|
+
|
|
6
|
+
export const CustomLightTheme = {
|
|
7
|
+
dark: false,
|
|
8
|
+
roundness: 4,
|
|
9
|
+
version: 3,
|
|
10
|
+
isV3: true,
|
|
11
|
+
colors: {
|
|
12
|
+
primary: palette.primary40,
|
|
13
|
+
primaryContainer: palette.primary90,
|
|
14
|
+
secondary: palette.secondary40,
|
|
15
|
+
secondaryContainer: palette.secondary90,
|
|
16
|
+
tertiary: palette.tertiary40,
|
|
17
|
+
tertiaryContainer: palette.tertiary90,
|
|
18
|
+
surface: palette.neutral99,
|
|
19
|
+
surfaceVariant: palette.neutralVariant90,
|
|
20
|
+
surfaceDisabled: color(palette.neutral10)
|
|
21
|
+
.alpha(opacity.level2)
|
|
22
|
+
.rgb()
|
|
23
|
+
.string(),
|
|
24
|
+
background: palette.neutral99,
|
|
25
|
+
error: palette.error40,
|
|
26
|
+
errorContainer: palette.error90,
|
|
27
|
+
onPrimary: palette.primary100,
|
|
28
|
+
onPrimaryContainer: palette.primary10,
|
|
29
|
+
onSecondary: palette.secondary100,
|
|
30
|
+
onSecondaryContainer: palette.secondary10,
|
|
31
|
+
onTertiary: palette.tertiary100,
|
|
32
|
+
onTertiaryContainer: palette.tertiary10,
|
|
33
|
+
onSurface: palette.neutral10,
|
|
34
|
+
onSurfaceVariant: palette.neutralVariant30,
|
|
35
|
+
onSurfaceDisabled: color(palette.neutral10)
|
|
36
|
+
.alpha(opacity.level4)
|
|
37
|
+
.rgb()
|
|
38
|
+
.string(),
|
|
39
|
+
onError: palette.error100,
|
|
40
|
+
onErrorContainer: palette.error10,
|
|
41
|
+
onBackground: palette.neutral10,
|
|
42
|
+
outline: palette.neutralVariant50,
|
|
43
|
+
outlineVariant: palette.neutralVariant80,
|
|
44
|
+
inverseSurface: palette.neutral20,
|
|
45
|
+
inverseOnSurface: palette.neutral95,
|
|
46
|
+
inversePrimary: palette.primary80,
|
|
47
|
+
shadow: palette.neutral0,
|
|
48
|
+
scrim: palette.neutral0,
|
|
49
|
+
backdrop: color(MD3Colors.neutralVariant20).alpha(0.4).rgb().string(),
|
|
50
|
+
elevation: {
|
|
51
|
+
level0: '#F9FAF5',
|
|
52
|
+
// Note: Color values with transparency cause RN to transfer shadows to children nodes
|
|
53
|
+
// instead of View component in Surface. Providing solid background fixes the issue.
|
|
54
|
+
// Opaque color values generated with `palette.primary99` used as background
|
|
55
|
+
level1: '#F9FAF5', // palette.primary40, alpha 0.05
|
|
56
|
+
level2: '#F9FAF5', // palette.primary40, alpha 0.08
|
|
57
|
+
level3: '#F9FAF5', // palette.primary40, alpha 0.11
|
|
58
|
+
level4: '#F9FAF5', // palette.primary40, alpha 0.12
|
|
59
|
+
level5: '#F9FAF5', // palette.primary40, alpha 0.14
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
fonts: typescale,
|
|
63
|
+
animation: {
|
|
64
|
+
scale: 1.0,
|
|
65
|
+
},
|
|
66
|
+
} as MD3Theme;
|
|
67
|
+
|
|
68
|
+
export const CustomDarkTheme = {
|
|
69
|
+
...CustomLightTheme,
|
|
70
|
+
dark: true,
|
|
71
|
+
mode: 'adaptive',
|
|
72
|
+
version: 3,
|
|
73
|
+
isV3: true,
|
|
74
|
+
colors: {
|
|
75
|
+
primary: palette.primary80,
|
|
76
|
+
primaryContainer: palette.primary30,
|
|
77
|
+
secondary: palette.secondary80,
|
|
78
|
+
secondaryContainer: palette.secondary30,
|
|
79
|
+
tertiary: palette.tertiary80,
|
|
80
|
+
tertiaryContainer: palette.tertiary30,
|
|
81
|
+
surface: palette.neutral10,
|
|
82
|
+
surfaceVariant: palette.neutralVariant30,
|
|
83
|
+
surfaceDisabled: color(palette.neutral90)
|
|
84
|
+
.alpha(opacity.level2)
|
|
85
|
+
.rgb()
|
|
86
|
+
.string(),
|
|
87
|
+
background: palette.neutral10,
|
|
88
|
+
error: palette.error80,
|
|
89
|
+
errorContainer: palette.error30,
|
|
90
|
+
onPrimary: palette.primary20,
|
|
91
|
+
onPrimaryContainer: palette.primary90,
|
|
92
|
+
onSecondary: palette.secondary20,
|
|
93
|
+
onSecondaryContainer: palette.secondary90,
|
|
94
|
+
onTertiary: palette.tertiary20,
|
|
95
|
+
onTertiaryContainer: palette.tertiary90,
|
|
96
|
+
onSurface: palette.neutral90,
|
|
97
|
+
onSurfaceVariant: palette.neutralVariant80,
|
|
98
|
+
onSurfaceDisabled: color(palette.neutral90)
|
|
99
|
+
.alpha(opacity.level4)
|
|
100
|
+
.rgb()
|
|
101
|
+
.string(),
|
|
102
|
+
onError: palette.error20,
|
|
103
|
+
onErrorContainer: palette.error80,
|
|
104
|
+
onBackground: palette.neutral90,
|
|
105
|
+
outline: palette.neutralVariant60,
|
|
106
|
+
outlineVariant: palette.neutralVariant30,
|
|
107
|
+
inverseSurface: palette.neutral90,
|
|
108
|
+
inverseOnSurface: palette.neutral20,
|
|
109
|
+
inversePrimary: palette.primary40,
|
|
110
|
+
shadow: palette.neutral0,
|
|
111
|
+
scrim: palette.neutral0,
|
|
112
|
+
backdrop: color(MD3Colors.neutralVariant80).alpha(0.4).rgb().string(),
|
|
113
|
+
elevation: {
|
|
114
|
+
level0: 'transparent',
|
|
115
|
+
// Note: Color values with transparency cause RN to transfer shadows to children nodes
|
|
116
|
+
// instead of View component in Surface. Providing solid background fixes the issue.
|
|
117
|
+
// Opaque color values generated with `palette.primary80` used as background
|
|
118
|
+
level1: 'rgb(25, 28, 26)',
|
|
119
|
+
level2: 'rgb(25, 28, 26)',
|
|
120
|
+
level3: 'rgb(25, 28, 26)',
|
|
121
|
+
level4: 'rgb(25, 28, 26)',
|
|
122
|
+
level5: 'rgb(25, 28, 26)',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
} as MD3Theme;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
const ref = {
|
|
2
|
+
palette: {
|
|
3
|
+
primary100: 'white',
|
|
4
|
+
primary99: '#F5FFF4',
|
|
5
|
+
primary95: '#C1FFD4',
|
|
6
|
+
primary90: '#80FAB2',
|
|
7
|
+
primary80: '#63DD98',
|
|
8
|
+
primary70: '#43C17E',
|
|
9
|
+
primary60: '#1CA566',
|
|
10
|
+
primary50: '#008951',
|
|
11
|
+
primary40: '#006D40',
|
|
12
|
+
primary30: '#00522F',
|
|
13
|
+
primary20: '#00391F',
|
|
14
|
+
primary10: '#002110',
|
|
15
|
+
primary0: 'black',
|
|
16
|
+
secondary100: 'white',
|
|
17
|
+
secondary99: '#F5FFF4',
|
|
18
|
+
secondary95: '#DFF7E3',
|
|
19
|
+
secondary90: '#D1E8D5',
|
|
20
|
+
secondary80: '#B5CCBA',
|
|
21
|
+
secondary70: '#9AB19F',
|
|
22
|
+
secondary60: '#809685',
|
|
23
|
+
secondary50: '#677C6C',
|
|
24
|
+
secondary40: '#4F6354',
|
|
25
|
+
secondary30: '#374B3D',
|
|
26
|
+
secondary20: '#213528',
|
|
27
|
+
secondary10: '#0C1F14',
|
|
28
|
+
secondary0: 'black',
|
|
29
|
+
tertiary100: 'white',
|
|
30
|
+
tertiary99: '#F8FDFF',
|
|
31
|
+
tertiary95: '#DAF5FF',
|
|
32
|
+
tertiary90: '#BEE9F8',
|
|
33
|
+
tertiary80: '#A3CDDB',
|
|
34
|
+
tertiary70: '#88B2BF',
|
|
35
|
+
tertiary60: '#6E97A4',
|
|
36
|
+
tertiary50: '#547D8A',
|
|
37
|
+
tertiary40: '#3B6470',
|
|
38
|
+
tertiary30: '#214C58',
|
|
39
|
+
tertiary20: '#033641',
|
|
40
|
+
tertiary10: '#001F27',
|
|
41
|
+
tertiary0: 'black',
|
|
42
|
+
neutral100: 'white',
|
|
43
|
+
neutral99: '#FBFDF8',
|
|
44
|
+
neutral95: '#F0F1EC',
|
|
45
|
+
neutral90: '#E1E3DE',
|
|
46
|
+
neutral80: '#C5C7C3',
|
|
47
|
+
neutral70: '#AAACA8',
|
|
48
|
+
neutral60: '#8F918D',
|
|
49
|
+
neutral50: '#757874',
|
|
50
|
+
neutral40: '#5C5F5C',
|
|
51
|
+
neutral30: '#454744',
|
|
52
|
+
neutral20: '#454744',
|
|
53
|
+
neutral10: '#191C1A',
|
|
54
|
+
neutral0: 'black',
|
|
55
|
+
neutralVariant100: 'white',
|
|
56
|
+
neutralVariant99: '#F6FFF5',
|
|
57
|
+
neutralVariant95: '#EBF3E9',
|
|
58
|
+
neutralVariant90: '#DCE5DB',
|
|
59
|
+
neutralVariant80: '#C0C9C0',
|
|
60
|
+
neutralVariant70: '#A5ADA5',
|
|
61
|
+
neutralVariant60: '#8A938B',
|
|
62
|
+
neutralVariant50: '#717971',
|
|
63
|
+
neutralVariant40: '#586059',
|
|
64
|
+
neutralVariant30: '#414942',
|
|
65
|
+
neutralVariant20: '#2A322C',
|
|
66
|
+
neutralVariant10: '#161D18',
|
|
67
|
+
neutralVariant0: 'black',
|
|
68
|
+
error100: 'white',
|
|
69
|
+
error99: '#FFFBFF',
|
|
70
|
+
error95: '#FFEDEA',
|
|
71
|
+
error90: '#FFDAD6',
|
|
72
|
+
error80: '#FFB4AB',
|
|
73
|
+
error70: '#FF897D',
|
|
74
|
+
error60: '#FF5449',
|
|
75
|
+
error50: '#DE3730',
|
|
76
|
+
error40: '#BA1A1A',
|
|
77
|
+
error30: '#93000A',
|
|
78
|
+
error20: '#690005',
|
|
79
|
+
error10: '#410002',
|
|
80
|
+
error0: 'black',
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
typeface: {
|
|
84
|
+
brandRegular: 'Avenir-Regular',
|
|
85
|
+
plainMedium: 'Avenir-Medium',
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
opacity: {
|
|
89
|
+
level1: 0.08,
|
|
90
|
+
level2: 0.12,
|
|
91
|
+
level3: 0.16,
|
|
92
|
+
level4: 0.38,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const regularType = {
|
|
97
|
+
fontFamily: ref.typeface.brandRegular,
|
|
98
|
+
letterSpacing: 0,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const mediumType = {
|
|
102
|
+
fontFamily: ref.typeface.plainMedium,
|
|
103
|
+
letterSpacing: 0.15,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const typescale = {
|
|
107
|
+
displayLarge: {
|
|
108
|
+
...regularType,
|
|
109
|
+
lineHeight: 64,
|
|
110
|
+
fontSize: 57,
|
|
111
|
+
},
|
|
112
|
+
displayMedium: {
|
|
113
|
+
...regularType,
|
|
114
|
+
lineHeight: 52,
|
|
115
|
+
fontSize: 45,
|
|
116
|
+
},
|
|
117
|
+
displaySmall: {
|
|
118
|
+
...regularType,
|
|
119
|
+
lineHeight: 44,
|
|
120
|
+
fontSize: 36,
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
headlineLarge: {
|
|
124
|
+
...regularType,
|
|
125
|
+
lineHeight: 40,
|
|
126
|
+
fontSize: 32,
|
|
127
|
+
},
|
|
128
|
+
headlineMedium: {
|
|
129
|
+
...regularType,
|
|
130
|
+
lineHeight: 36,
|
|
131
|
+
fontSize: 28,
|
|
132
|
+
},
|
|
133
|
+
headlineSmall: {
|
|
134
|
+
...regularType,
|
|
135
|
+
lineHeight: 32,
|
|
136
|
+
fontSize: 24,
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
titleLarge: {
|
|
140
|
+
...regularType,
|
|
141
|
+
lineHeight: 28,
|
|
142
|
+
fontSize: 22,
|
|
143
|
+
},
|
|
144
|
+
titleMedium: {
|
|
145
|
+
...mediumType,
|
|
146
|
+
letterSpacing: 0.15,
|
|
147
|
+
lineHeight: 24,
|
|
148
|
+
fontSize: 16,
|
|
149
|
+
},
|
|
150
|
+
titleSmall: {
|
|
151
|
+
...mediumType,
|
|
152
|
+
letterSpacing: 0.1,
|
|
153
|
+
lineHeight: 20,
|
|
154
|
+
fontSize: 14,
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
labelLarge: {
|
|
158
|
+
...mediumType,
|
|
159
|
+
letterSpacing: 0.1,
|
|
160
|
+
lineHeight: 20,
|
|
161
|
+
fontSize: 14,
|
|
162
|
+
},
|
|
163
|
+
labelMedium: {
|
|
164
|
+
...mediumType,
|
|
165
|
+
letterSpacing: 0.5,
|
|
166
|
+
lineHeight: 16,
|
|
167
|
+
fontSize: 12,
|
|
168
|
+
},
|
|
169
|
+
labelSmall: {
|
|
170
|
+
...mediumType,
|
|
171
|
+
letterSpacing: 0.5,
|
|
172
|
+
lineHeight: 16,
|
|
173
|
+
fontSize: 11,
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
bodyLarge: {
|
|
177
|
+
...regularType,
|
|
178
|
+
letterSpacing: 0.5,
|
|
179
|
+
lineHeight: 24,
|
|
180
|
+
fontSize: 16,
|
|
181
|
+
},
|
|
182
|
+
bodyMedium: {
|
|
183
|
+
...regularType,
|
|
184
|
+
letterSpacing: 0.25,
|
|
185
|
+
lineHeight: 20,
|
|
186
|
+
fontSize: 14,
|
|
187
|
+
},
|
|
188
|
+
bodySmall: {
|
|
189
|
+
...regularType,
|
|
190
|
+
letterSpacing: 0.4,
|
|
191
|
+
lineHeight: 16,
|
|
192
|
+
fontSize: 12,
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
default: {
|
|
196
|
+
...regularType,
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export const tokens = {
|
|
201
|
+
md: {
|
|
202
|
+
ref,
|
|
203
|
+
sys: {
|
|
204
|
+
typescale,
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export const MD3Colors = ref.palette;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
type RootStackType = any;
|