@janiscommerce/ui-native 1.26.0 → 1.27.0-beta.0

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.
Files changed (208) hide show
  1. package/package.json +14 -11
  2. package/dist/android/app/_BUCK +0 -55
  3. package/dist/android/app/build.gradle +0 -230
  4. package/dist/android/app/build_defs.bzl +0 -19
  5. package/dist/android/app/debug.keystore +0 -0
  6. package/dist/android/app/proguard-rules.pro +0 -10
  7. package/dist/android/app/src/debug/AndroidManifest.xml +0 -13
  8. package/dist/android/app/src/debug/java/com/myapp/ReactNativeFlipper.java +0 -72
  9. package/dist/android/app/src/main/AndroidManifest.xml +0 -25
  10. package/dist/android/app/src/main/assets/fonts/Roboto-Bold.ttf +0 -0
  11. package/dist/android/app/src/main/assets/fonts/Roboto-Light.ttf +0 -0
  12. package/dist/android/app/src/main/assets/fonts/Roboto-Medium.ttf +0 -0
  13. package/dist/android/app/src/main/assets/fonts/Roboto-Regular.ttf +0 -0
  14. package/dist/android/app/src/main/assets/fonts/janis-font-icon.ttf +0 -0
  15. package/dist/android/app/src/main/java/com/myapp/MainActivity.java +0 -15
  16. package/dist/android/app/src/main/java/com/myapp/MainApplication.java +0 -80
  17. package/dist/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
  18. package/dist/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  19. package/dist/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  20. package/dist/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  21. package/dist/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  22. package/dist/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  23. package/dist/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  24. package/dist/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  25. package/dist/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  26. package/dist/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  27. package/dist/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  28. package/dist/android/app/src/main/res/values/strings.xml +0 -3
  29. package/dist/android/app/src/main/res/values/styles.xml +0 -9
  30. package/dist/android/build.gradle +0 -42
  31. package/dist/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  32. package/dist/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  33. package/dist/android/gradle.properties +0 -28
  34. package/dist/android/gradlew +0 -185
  35. package/dist/android/gradlew.bat +0 -89
  36. package/dist/android/settings.gradle +0 -6
  37. package/dist/components/atoms/BaseButton/index.d.ts +0 -10
  38. package/dist/components/atoms/BaseButton/index.js +0 -24
  39. package/dist/components/atoms/BaseCardList/index.d.ts +0 -8
  40. package/dist/components/atoms/BaseCardList/index.js +0 -33
  41. package/dist/components/atoms/BaseInput/index.d.ts +0 -10
  42. package/dist/components/atoms/BaseInput/index.js +0 -7
  43. package/dist/components/atoms/BaseToast/index.d.ts +0 -17
  44. package/dist/components/atoms/BaseToast/index.js +0 -31
  45. package/dist/components/atoms/BaseToast/utils/index.d.ts +0 -7
  46. package/dist/components/atoms/BaseToast/utils/index.js +0 -7
  47. package/dist/components/atoms/CheckBox/icon/CheckedIcon.d.ts +0 -13
  48. package/dist/components/atoms/CheckBox/icon/CheckedIcon.js +0 -14
  49. package/dist/components/atoms/CheckBox/index.d.ts +0 -15
  50. package/dist/components/atoms/CheckBox/index.js +0 -43
  51. package/dist/components/atoms/Collapsible/index.d.ts +0 -24
  52. package/dist/components/atoms/Collapsible/index.js +0 -59
  53. package/dist/components/atoms/Icon/assets/fonts/selection.json +0 -1
  54. package/dist/components/atoms/Icon/index.d.ts +0 -9
  55. package/dist/components/atoms/Icon/index.js +0 -14
  56. package/dist/components/atoms/Image/index.d.ts +0 -10
  57. package/dist/components/atoms/Image/index.js +0 -30
  58. package/dist/components/atoms/Input/index.d.ts +0 -31
  59. package/dist/components/atoms/Input/index.js +0 -94
  60. package/dist/components/atoms/Input/utils/index.d.ts +0 -28
  61. package/dist/components/atoms/Input/utils/index.js +0 -44
  62. package/dist/components/atoms/List/index.d.ts +0 -26
  63. package/dist/components/atoms/List/index.js +0 -21
  64. package/dist/components/atoms/Loading/LoadingSvg/index.d.ts +0 -8
  65. package/dist/components/atoms/Loading/LoadingSvg/index.js +0 -13
  66. package/dist/components/atoms/Loading/index.d.ts +0 -12
  67. package/dist/components/atoms/Loading/index.js +0 -60
  68. package/dist/components/atoms/Modal/index.d.ts +0 -15
  69. package/dist/components/atoms/Modal/index.js +0 -83
  70. package/dist/components/atoms/RadioButton/index.d.ts +0 -22
  71. package/dist/components/atoms/RadioButton/index.js +0 -49
  72. package/dist/components/atoms/StatusChip/index.d.ts +0 -8
  73. package/dist/components/atoms/StatusChip/index.js +0 -44
  74. package/dist/components/atoms/Svg/index.d.ts +0 -24
  75. package/dist/components/atoms/Svg/index.js +0 -31
  76. package/dist/components/atoms/Svg/svgs/EmptyIllustration.d.ts +0 -4
  77. package/dist/components/atoms/Svg/svgs/EmptyIllustration.js +0 -23
  78. package/dist/components/atoms/Svg/svgs/EmptyListIllustration.d.ts +0 -4
  79. package/dist/components/atoms/Svg/svgs/EmptyListIllustration.js +0 -73
  80. package/dist/components/atoms/Svg/svgs/EmptyNotifications.d.ts +0 -4
  81. package/dist/components/atoms/Svg/svgs/EmptyNotifications.js +0 -17
  82. package/dist/components/atoms/Svg/svgs/JanisCommerceLogo.d.ts +0 -4
  83. package/dist/components/atoms/Svg/svgs/JanisCommerceLogo.js +0 -48
  84. package/dist/components/atoms/Svg/svgs/JanisCommerceLogoBeta.d.ts +0 -4
  85. package/dist/components/atoms/Svg/svgs/JanisCommerceLogoBeta.js +0 -50
  86. package/dist/components/atoms/Svg/svgs/JanisCommerceLogoQa.d.ts +0 -4
  87. package/dist/components/atoms/Svg/svgs/JanisCommerceLogoQa.js +0 -50
  88. package/dist/components/atoms/Svg/svgs/JanisIso.d.ts +0 -4
  89. package/dist/components/atoms/Svg/svgs/JanisIso.js +0 -29
  90. package/dist/components/atoms/Svg/svgs/LoginIllustration.d.ts +0 -4
  91. package/dist/components/atoms/Svg/svgs/LoginIllustration.js +0 -31
  92. package/dist/components/atoms/Svg/svgs/index.d.ts +0 -12
  93. package/dist/components/atoms/Svg/svgs/index.js +0 -19
  94. package/dist/components/atoms/SwipeUp/childComponents/index.d.ts +0 -11
  95. package/dist/components/atoms/SwipeUp/childComponents/index.js +0 -22
  96. package/dist/components/atoms/SwipeUp/index.d.ts +0 -10
  97. package/dist/components/atoms/SwipeUp/index.js +0 -11
  98. package/dist/components/atoms/Text/index.d.ts +0 -8
  99. package/dist/components/atoms/Text/index.js +0 -19
  100. package/dist/components/atoms/Typography/index.d.ts +0 -13
  101. package/dist/components/atoms/Typography/index.js +0 -13
  102. package/dist/components/atoms/Typography/utils/getStyleByTypography/index.d.ts +0 -8
  103. package/dist/components/atoms/Typography/utils/getStyleByTypography/index.js +0 -19
  104. package/dist/components/molecules/Avatar/index.d.ts +0 -22
  105. package/dist/components/molecules/Avatar/index.js +0 -64
  106. package/dist/components/molecules/Avatar/utils/formatPlaceholder/index.d.ts +0 -12
  107. package/dist/components/molecules/Avatar/utils/formatPlaceholder/index.js +0 -20
  108. package/dist/components/molecules/BaseDetail/components/BaseDetailModal/index.d.ts +0 -8
  109. package/dist/components/molecules/BaseDetail/components/BaseDetailModal/index.js +0 -12
  110. package/dist/components/molecules/BaseDetail/components/BaseDetailSwipe/index.d.ts +0 -7
  111. package/dist/components/molecules/BaseDetail/components/BaseDetailSwipe/index.js +0 -12
  112. package/dist/components/molecules/BaseDetail/components/index.d.ts +0 -3
  113. package/dist/components/molecules/BaseDetail/components/index.js +0 -3
  114. package/dist/components/molecules/BaseDetail/index.d.ts +0 -8
  115. package/dist/components/molecules/BaseDetail/index.js +0 -9
  116. package/dist/components/molecules/BaseDetail/types/index.d.ts +0 -15
  117. package/dist/components/molecules/BaseDetail/types/index.js +0 -1
  118. package/dist/components/molecules/Button/index.d.ts +0 -50
  119. package/dist/components/molecules/Button/index.js +0 -57
  120. package/dist/components/molecules/Button/types/index.d.ts +0 -45
  121. package/dist/components/molecules/Button/types/index.js +0 -1
  122. package/dist/components/molecules/Button/utils/getButtonStyles/index.d.ts +0 -3
  123. package/dist/components/molecules/Button/utils/getButtonStyles/index.js +0 -84
  124. package/dist/components/molecules/Button/utils/getButtonStyles/utils/constants/index.d.ts +0 -5
  125. package/dist/components/molecules/Button/utils/getButtonStyles/utils/constants/index.js +0 -5
  126. package/dist/components/molecules/Button/utils/getButtonStyles/utils/defaultValues/index.d.ts +0 -5
  127. package/dist/components/molecules/Button/utils/getButtonStyles/utils/defaultValues/index.js +0 -5
  128. package/dist/components/molecules/Button/utils/getButtonStyles/utils/styleConfigs/index.d.ts +0 -120
  129. package/dist/components/molecules/Button/utils/getButtonStyles/utils/styleConfigs/index.js +0 -123
  130. package/dist/components/molecules/Carousel/index.d.ts +0 -19
  131. package/dist/components/molecules/Carousel/index.js +0 -35
  132. package/dist/components/molecules/Carousel/utils/index.d.ts +0 -13
  133. package/dist/components/molecules/Carousel/utils/index.js +0 -102
  134. package/dist/components/molecules/ErrorBoundary/components/ErrorFallback/index.d.ts +0 -3
  135. package/dist/components/molecules/ErrorBoundary/components/ErrorFallback/index.js +0 -24
  136. package/dist/components/molecules/ErrorBoundary/index.d.ts +0 -20
  137. package/dist/components/molecules/ErrorBoundary/index.js +0 -37
  138. package/dist/components/molecules/Input/index.d.ts +0 -26
  139. package/dist/components/molecules/Input/index.js +0 -94
  140. package/dist/components/molecules/Input/utils/handleChangeText/index.d.ts +0 -3
  141. package/dist/components/molecules/Input/utils/handleChangeText/index.js +0 -16
  142. package/dist/components/molecules/ItemSelectionButton/index.d.ts +0 -11
  143. package/dist/components/molecules/ItemSelectionButton/index.js +0 -66
  144. package/dist/components/molecules/LayoutWithBottomButtons/index.d.ts +0 -11
  145. package/dist/components/molecules/LayoutWithBottomButtons/index.js +0 -72
  146. package/dist/components/molecules/LayoutWithBottomButtons/utils/index.d.ts +0 -364
  147. package/dist/components/molecules/LayoutWithBottomButtons/utils/index.js +0 -148
  148. package/dist/components/molecules/MainCardList/index.d.ts +0 -14
  149. package/dist/components/molecules/MainCardList/index.js +0 -60
  150. package/dist/components/molecules/ProgressBar/index.d.ts +0 -11
  151. package/dist/components/molecules/ProgressBar/index.js +0 -58
  152. package/dist/components/molecules/ProgressBar/utils/index.d.ts +0 -20
  153. package/dist/components/molecules/ProgressBar/utils/index.js +0 -52
  154. package/dist/components/molecules/Select/Components/Dropdown/index.d.ts +0 -10
  155. package/dist/components/molecules/Select/Components/Dropdown/index.js +0 -23
  156. package/dist/components/molecules/Select/Components/Modal/index.d.ts +0 -8
  157. package/dist/components/molecules/Select/Components/Modal/index.js +0 -59
  158. package/dist/components/molecules/Select/Components/Options/index.d.ts +0 -18
  159. package/dist/components/molecules/Select/Components/Options/index.js +0 -75
  160. package/dist/components/molecules/Select/Components/SwitcherComponent/index.d.ts +0 -13
  161. package/dist/components/molecules/Select/Components/SwitcherComponent/index.js +0 -8
  162. package/dist/components/molecules/Select/index.d.ts +0 -51
  163. package/dist/components/molecules/Select/index.js +0 -178
  164. package/dist/components/molecules/Select/utils/index.d.ts +0 -2
  165. package/dist/components/molecules/Select/utils/index.js +0 -7
  166. package/dist/components/molecules/SwipeList/index.d.ts +0 -11
  167. package/dist/components/molecules/SwipeList/index.js +0 -31
  168. package/dist/components/molecules/Tabs/index.d.ts +0 -23
  169. package/dist/components/molecules/Tabs/index.js +0 -112
  170. package/dist/components/molecules/Toast/index.d.ts +0 -23
  171. package/dist/components/molecules/Toast/index.js +0 -96
  172. package/dist/components/molecules/Toast/utils/index.d.ts +0 -7
  173. package/dist/components/molecules/Toast/utils/index.js +0 -7
  174. package/dist/components/organisms/FullScreenMessage/index.d.ts +0 -21
  175. package/dist/components/organisms/FullScreenMessage/index.js +0 -73
  176. package/dist/components/organisms/LoadingFullScreen/index.d.ts +0 -12
  177. package/dist/components/organisms/LoadingFullScreen/index.js +0 -41
  178. package/dist/components/organisms/ProductDetail/components/ProductInfo/index.d.ts +0 -9
  179. package/dist/components/organisms/ProductDetail/components/ProductInfo/index.js +0 -44
  180. package/dist/components/organisms/ProductDetail/index.d.ts +0 -9
  181. package/dist/components/organisms/ProductDetail/index.js +0 -10
  182. package/dist/components/organisms/SwipeItemSelectionList/index.d.ts +0 -14
  183. package/dist/components/organisms/SwipeItemSelectionList/index.js +0 -37
  184. package/dist/index.d.ts +0 -38
  185. package/dist/index.js +0 -42
  186. package/dist/ios/MyApp/AppDelegate.h +0 -8
  187. package/dist/ios/MyApp/AppDelegate.m +0 -58
  188. package/dist/ios/MyApp/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
  189. package/dist/ios/MyApp/Images.xcassets/Contents.json +0 -6
  190. package/dist/ios/MyApp/Info.plist +0 -55
  191. package/dist/ios/MyApp/LaunchScreen.storyboard +0 -58
  192. package/dist/ios/MyApp/main.m +0 -9
  193. package/dist/ios/MyApp.xcodeproj/project.pbxproj +0 -791
  194. package/dist/ios/MyApp.xcodeproj/xcshareddata/xcschemes/MyApp-tvOS.xcscheme +0 -88
  195. package/dist/ios/MyApp.xcodeproj/xcshareddata/xcschemes/MyApp.xcscheme +0 -88
  196. package/dist/ios/MyAppTests/Info.plist +0 -24
  197. package/dist/ios/MyAppTests/MyAppTests.m +0 -65
  198. package/dist/ios/Podfile +0 -33
  199. package/dist/scale/index.d.ts +0 -8
  200. package/dist/scale/index.js +0 -13
  201. package/dist/theme/palette.d.ts +0 -13
  202. package/dist/theme/palette.js +0 -63
  203. package/dist/theme/typography.d.ts +0 -37
  204. package/dist/theme/typography.js +0 -94
  205. package/dist/ts/interfaces/colors.d.ts +0 -55
  206. package/dist/ts/interfaces/colors.js +0 -1
  207. package/dist/utils/index.d.ts +0 -3
  208. package/dist/utils/index.js +0 -7
@@ -1,9 +0,0 @@
1
- import { FC } from 'react';
2
- export interface Props {
3
- name: string;
4
- color?: string;
5
- size?: number;
6
- style?: any;
7
- }
8
- declare const Icon: FC<Props>;
9
- export default Icon;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
3
- import icoMoonConfig from './assets/fonts/selection.json';
4
- import { primary } from '../../../theme/palette';
5
- import { moderateScale, scaledForDevice } from '../../../scale';
6
- const IconComponent = createIconSetFromIcoMoon(icoMoonConfig, 'janis-font-icon', 'janis-font-icon.ttf');
7
- const Icon = ({ name, color = primary.main, size = 16, ...props }) => {
8
- if (!name) {
9
- return null;
10
- }
11
- const validateSize = scaledForDevice(size, moderateScale);
12
- return <IconComponent name={name} color={color} size={validateSize} {...props}/>;
13
- };
14
- export default Icon;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { Props as NativeIconProps } from '../Icon';
3
- import { ViewStyle } from 'react-native';
4
- import { FastImageProps } from 'react-native-fast-image';
5
- interface ImageProps extends FastImageProps {
6
- iconProps?: NativeIconProps;
7
- iconBackgroundStyle?: ViewStyle;
8
- }
9
- declare const Image: ({ source, iconProps, iconBackgroundStyle, onError, ...props }: ImageProps) => React.JSX.Element;
10
- export default Image;
@@ -1,30 +0,0 @@
1
- import React, { useState } from 'react';
2
- import Icon from '../Icon';
3
- import { palette } from '../../../theme/palette';
4
- import { View, StyleSheet } from 'react-native';
5
- import FastImage from 'react-native-fast-image';
6
- const Image = ({ source, iconProps, iconBackgroundStyle = {}, onError, ...props }) => {
7
- const [showPlaceholderImage, setShowPlaceholderImage] = useState(false);
8
- const styles = StyleSheet.create({
9
- iconBackground: {
10
- backgroundColor: palette.white.light,
11
- display: 'flex',
12
- alignItems: 'center',
13
- justifyContent: 'center',
14
- },
15
- });
16
- const placeholderStyle = [styles.iconBackground, iconBackgroundStyle, props.style].filter(Boolean);
17
- const handleError = () => {
18
- if (onError) {
19
- onError();
20
- }
21
- setShowPlaceholderImage(true);
22
- };
23
- if (showPlaceholderImage || !source) {
24
- return (<View style={placeholderStyle}>
25
- <Icon name="exclamation_circle" color={palette.white.dark} size={36} {...iconProps}/>
26
- </View>);
27
- }
28
- return <FastImage onError={handleError} source={source} {...props}/>;
29
- };
30
- export default Image;
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import { TextInput, KeyboardType, TextStyle } from 'react-native';
3
- import { Status } from './utils';
4
- export declare enum keyboardTypes {
5
- default = "default",
6
- numberPad = "number-pad",
7
- decimalPad = "decimal-pad",
8
- numeric = "numeric",
9
- emailAddress = "email-address",
10
- phonePad = "phone-pad",
11
- url = "url"
12
- }
13
- interface InputProps {
14
- disabled?: boolean;
15
- readOnly?: boolean;
16
- label: string;
17
- placeholder: string;
18
- value?: number | string;
19
- inputColor?: string;
20
- valueColor?: string;
21
- status?: Status;
22
- statusMessage?: string;
23
- keyboardType?: KeyboardType;
24
- onChange?: () => void;
25
- onSubmitEditing?: () => void;
26
- onFocus?: () => void;
27
- onBlur?: () => void;
28
- style?: TextStyle;
29
- }
30
- declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInput>>;
31
- export default Input;
@@ -1,94 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { TextInput, StyleSheet, View, Text, } from 'react-native';
3
- import { getBorderColor, getInputInitialState, getLabelColor, getStatusMessageColor, raiseLabel, showStatusMessage, } from './utils';
4
- import { moderateScale, horizontalScale, scaledForDevice } from '../../../scale';
5
- export var keyboardTypes;
6
- (function (keyboardTypes) {
7
- keyboardTypes["default"] = "default";
8
- keyboardTypes["numberPad"] = "number-pad";
9
- keyboardTypes["decimalPad"] = "decimal-pad";
10
- keyboardTypes["numeric"] = "numeric";
11
- keyboardTypes["emailAddress"] = "email-address";
12
- keyboardTypes["phonePad"] = "phone-pad";
13
- keyboardTypes["url"] = "url";
14
- })(keyboardTypes || (keyboardTypes = {}));
15
- const Input = React.forwardRef(({ disabled = false, readOnly = false, label, placeholder, value = '', inputColor = '#2979FF', valueColor = '#2F2F2F', status = 'error', statusMessage = '', keyboardType = keyboardTypes.default, onChange = () => { }, onSubmitEditing = () => { }, onFocus = () => { }, onBlur = () => { }, style, ...props }, ref) => {
16
- const [inputState, setInputState] = useState('incomplete');
17
- useEffect(() => {
18
- setInputState(getInputInitialState(value?.toString()));
19
- }, [value]);
20
- if (!label || !placeholder) {
21
- return null;
22
- }
23
- const onFocusHandler = () => {
24
- setInputState('focus');
25
- return onFocus();
26
- };
27
- const onEndEditingHandler = ({ nativeEvent, }) => {
28
- const { text = '' } = nativeEvent;
29
- if (text) {
30
- setInputState('complete');
31
- return onBlur();
32
- }
33
- setInputState('incomplete');
34
- return onBlur();
35
- };
36
- const hasMessage = !!statusMessage;
37
- const isLabelVisible = !disabled && !readOnly && (inputState !== 'incomplete' || hasMessage);
38
- const validBorderColor = getBorderColor({ inputState, hasMessage, status, inputColor });
39
- const validLabelColor = getLabelColor({
40
- disabled,
41
- readOnly,
42
- inputColor,
43
- inputState,
44
- statusMessage,
45
- status,
46
- });
47
- const validStatusMessageColor = getStatusMessageColor(status);
48
- const validBottom = scaledForDevice(25, moderateScale);
49
- const validHeight = scaledForDevice(50, moderateScale);
50
- const validBorderBottomWidth = scaledForDevice(1, horizontalScale);
51
- const validLineHeight = scaledForDevice(19, moderateScale);
52
- const validFontSize = scaledForDevice(16, moderateScale);
53
- const validateMarginTop = scaledForDevice(5, moderateScale);
54
- const styles = StyleSheet.create({
55
- container: {
56
- width: '100%',
57
- },
58
- inputWrapper: {
59
- height: validHeight,
60
- borderBottomColor: validBorderColor,
61
- borderBottomWidth: validBorderBottomWidth,
62
- justifyContent: 'flex-end',
63
- },
64
- label: {
65
- color: validLabelColor,
66
- fontSize: validFontSize,
67
- letterSpacing: 0,
68
- lineHeight: validLineHeight,
69
- position: 'absolute',
70
- bottom: raiseLabel({ disabled, hasMessage, inputState }) ? validBottom : 0,
71
- },
72
- input: {
73
- color: valueColor,
74
- fontSize: validFontSize,
75
- letterSpacing: 0,
76
- lineHeight: validLineHeight,
77
- padding: 0,
78
- },
79
- statusMessage: {
80
- color: validStatusMessageColor,
81
- marginTop: validateMarginTop,
82
- },
83
- });
84
- return (<View style={styles.container}>
85
- <View style={styles.inputWrapper}>
86
- {isLabelVisible && <Text style={styles.label}>{label}</Text>}
87
- <TextInput style={[styles.input, style]} ref={ref} onFocus={onFocusHandler} onEndEditing={onEndEditingHandler} onChange={onChange} onSubmitEditing={onSubmitEditing} placeholder={placeholder} editable={!(readOnly || disabled)} selectionColor={inputColor} keyboardType={keyboardType} value={value?.toString()} {...props}/>
88
- </View>
89
- {showStatusMessage(hasMessage, inputState) && (<View>
90
- <Text style={styles.statusMessage}>{statusMessage}</Text>
91
- </View>)}
92
- </View>);
93
- });
94
- export default Input;
@@ -1,28 +0,0 @@
1
- import { palette } from '../../../../theme/palette';
2
- export type Status = keyof typeof palette;
3
- interface getBorderColorProps {
4
- inputState: string;
5
- hasMessage: boolean;
6
- status: Status;
7
- inputColor: string;
8
- }
9
- interface getLabelColorProps {
10
- disabled: boolean;
11
- readOnly: boolean;
12
- inputColor: string;
13
- inputState: string;
14
- statusMessage: string;
15
- status: Status;
16
- }
17
- interface raiseLabelProps {
18
- disabled: boolean;
19
- hasMessage: boolean;
20
- inputState: string;
21
- }
22
- export declare const getInputInitialState: (value: string) => "incomplete" | "complete";
23
- export declare const getBorderColor: ({ inputState, hasMessage, status, inputColor, }: getBorderColorProps) => any;
24
- export declare const getLabelColor: ({ disabled, readOnly, inputColor, inputState, statusMessage, status, }: getLabelColorProps) => any;
25
- export declare const raiseLabel: ({ disabled, hasMessage, inputState }: raiseLabelProps) => boolean;
26
- export declare const showStatusMessage: (hasMessage: boolean, inputState: string) => boolean;
27
- export declare const getStatusMessageColor: (status: Status) => any;
28
- export {};
@@ -1,44 +0,0 @@
1
- import { palette } from '../../../../theme/palette';
2
- export const getInputInitialState = (value) => {
3
- if (!value) {
4
- return 'incomplete';
5
- }
6
- return 'complete';
7
- };
8
- export const getBorderColor = ({ inputState, hasMessage, status, inputColor, }) => {
9
- if (inputState === 'focus') {
10
- return inputColor;
11
- }
12
- if (hasMessage) {
13
- const colorPalette = palette[status];
14
- if ('main' in colorPalette) {
15
- return colorPalette.main;
16
- }
17
- return palette.error.main;
18
- }
19
- return palette.grey[500];
20
- };
21
- export const getLabelColor = ({ disabled, readOnly, inputColor, inputState, statusMessage, status, }) => {
22
- if (disabled || readOnly) {
23
- return palette.grey[500];
24
- }
25
- if (inputState === 'focus') {
26
- return inputColor;
27
- }
28
- if (statusMessage) {
29
- const colorPalette = palette[status];
30
- if ('main' in colorPalette) {
31
- return colorPalette.main;
32
- }
33
- }
34
- return palette.grey[500];
35
- };
36
- export const raiseLabel = ({ disabled, hasMessage, inputState }) => !disabled && (inputState !== 'incomplete' || !!hasMessage);
37
- export const showStatusMessage = (hasMessage, inputState) => !!hasMessage && inputState !== 'focus';
38
- export const getStatusMessageColor = (status) => {
39
- const colorPalette = palette[status];
40
- if ('main' in colorPalette) {
41
- return colorPalette.main;
42
- }
43
- return palette.error.main;
44
- };
@@ -1,26 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { FlatListProps, ScrollViewProps } from 'react-native';
3
- type TypeData = any;
4
- type RCProps = {
5
- item: TypeData;
6
- index: number;
7
- };
8
- type TypeRenderComponent = ({ item, index }: RCProps) => React.ReactElement;
9
- export declare enum TypeList {
10
- FlatList = "flatList",
11
- ScrollView = "scrollView"
12
- }
13
- interface BaseProps {
14
- data: TypeData[] | undefined;
15
- renderComponent: TypeRenderComponent;
16
- type?: TypeList;
17
- }
18
- type FlatListOnlyProps = Omit<FlatListProps<TypeData>, 'data' | 'renderItem'> & {
19
- type?: TypeList.FlatList;
20
- };
21
- type ScrollViewOnlyProps = ScrollViewProps & {
22
- type: TypeList.ScrollView;
23
- };
24
- type ListProps = BaseProps & (FlatListOnlyProps | ScrollViewOnlyProps);
25
- declare const List: FC<ListProps>;
26
- export default List;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { FlatList, ScrollView } from 'react-native';
3
- export var TypeList;
4
- (function (TypeList) {
5
- TypeList["FlatList"] = "flatList";
6
- TypeList["ScrollView"] = "scrollView";
7
- })(TypeList || (TypeList = {}));
8
- const List = ({ data, renderComponent, type = TypeList.FlatList, ...props }) => {
9
- if (!data?.length) {
10
- return null;
11
- }
12
- if (type === TypeList.ScrollView) {
13
- const scrollProps = props;
14
- return (<ScrollView {...scrollProps}>
15
- {data.map((item, index) => renderComponent({ item, index }))}
16
- </ScrollView>);
17
- }
18
- const cleanedFlatProps = props;
19
- return (<FlatList data={data} renderItem={({ item, index }) => renderComponent({ item, index })} keyExtractor={(item, index) => String(item.id ?? index)} {...cleanedFlatProps}/>);
20
- };
21
- export default List;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { Animated, ViewProps } from 'react-native';
3
- interface IanimatedView extends Animated.AnimatedProps<ViewProps> {
4
- size?: number;
5
- color?: string;
6
- }
7
- declare const LoadingSvg: ({ size, color, ...props }: IanimatedView) => React.JSX.Element;
8
- export default LoadingSvg;
@@ -1,13 +0,0 @@
1
- import Svg, { Path } from 'react-native-svg';
2
- import React from 'react';
3
- import { Animated } from 'react-native';
4
- import { white } from '../../../../theme/palette';
5
- const LoadingSvg = ({ size, color, ...props }) => {
6
- return (<Animated.View {...props}>
7
- <Svg x="0px" y="0px" width={size} height={size} viewBox="0 0 163 163">
8
- <Path d="M134.1,136.4c-30.3,29.1-78.5,28-107.5-2.3c-29.1-30.3-28-78.5,2.3-107.5s78.5-28,107.5,2.3" fill="none" stroke={white.dark} strokeWidth="10.5546" strokeLinecap="round" strokeLinejoin="round"/>
9
- <Path id="path-color" d="M78.4,5.5c42-1.7,77.4,30.9,79.1,72.9c1.7,42-30.9,77.4-72.9,79.1c-42,1.7-77.4-30.9-79.1-72.9" fill="none" stroke={color} strokeWidth="10.5546" strokeLinecap="round" strokeLinejoin="round"/>
10
- </Svg>
11
- </Animated.View>);
12
- };
13
- export default LoadingSvg;
@@ -1,12 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { ViewStyle } from 'react-native';
3
- interface Props {
4
- isLoading: boolean;
5
- color?: string;
6
- size?: number;
7
- duration?: number;
8
- children?: React.ReactNode | null;
9
- style?: ViewStyle;
10
- }
11
- declare const Loading: FC<Props>;
12
- export default Loading;
@@ -1,60 +0,0 @@
1
- import React, { useEffect, useRef } from 'react';
2
- import { StyleSheet, View, Animated, Easing } from 'react-native';
3
- import LoadingSvg from './LoadingSvg';
4
- import { primary } from '../../../theme/palette';
5
- import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
6
- const startRotationAnimation = ({ duration, rotationDegree, timingAnimation }) => Animated.loop(Animated.timing(rotationDegree, {
7
- duration,
8
- toValue: 360,
9
- easing: timingAnimation,
10
- useNativeDriver: true,
11
- })).start();
12
- const Loading = ({ isLoading, color = primary.main, size = 64, duration = 1000, children = null, style, ...props }) => {
13
- const rotationDegree = useRef(new Animated.Value(0)).current;
14
- const validWidth = scaledForDevice(size, horizontalScale);
15
- const validHeight = scaledForDevice(size, moderateScale);
16
- const validSize = scaledForDevice(size, moderateScale);
17
- const styles = StyleSheet.create({
18
- container: {
19
- position: 'relative',
20
- justifyContent: 'center',
21
- alignItems: 'center',
22
- width: validWidth,
23
- height: validHeight,
24
- },
25
- spinner: {
26
- position: 'absolute',
27
- width: size,
28
- height: size,
29
- justifyContent: 'center',
30
- alignItems: 'center',
31
- },
32
- });
33
- const animationSpinnerStyle = {
34
- transform: [
35
- {
36
- rotateZ: rotationDegree.interpolate({
37
- inputRange: [0, 360],
38
- outputRange: ['0deg', '360deg'],
39
- }),
40
- },
41
- ],
42
- };
43
- useEffect(() => {
44
- if (isLoading) {
45
- startRotationAnimation({
46
- duration,
47
- rotationDegree,
48
- timingAnimation: Easing.linear,
49
- });
50
- }
51
- }, [isLoading, duration, rotationDegree]);
52
- if (!isLoading) {
53
- return <></>;
54
- }
55
- return (<View style={[styles.container, style]} {...props}>
56
- <LoadingSvg style={[styles.spinner, { ...animationSpinnerStyle }]} size={validSize} color={color}/>
57
- {children}
58
- </View>);
59
- };
60
- export default Loading;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { ModalProps as NativeModalProps, ViewStyle } from 'react-native';
3
- export interface UIModalProps extends NativeModalProps {
4
- oncloseCallback?: () => void;
5
- showCloseButton?: boolean;
6
- fullScreen?: boolean;
7
- modalContainerStyle?: ViewStyle;
8
- canClose?: boolean;
9
- }
10
- export interface ModalMethods {
11
- open?: () => void;
12
- close?: () => void;
13
- }
14
- declare const Modal: React.ForwardRefExoticComponent<UIModalProps & React.RefAttributes<ModalMethods>>;
15
- export default Modal;
@@ -1,83 +0,0 @@
1
- import Icon from '../Icon';
2
- import React, { useState, forwardRef, useImperativeHandle } from 'react';
3
- import { Modal as NativeModal, Pressable, StyleSheet, View, } from 'react-native';
4
- import { horizontalScale } from '../../../scale';
5
- import { verticalScale, moderateScale } from '../../../scale';
6
- import { palette } from '../../../theme/palette';
7
- const styles = StyleSheet.create({
8
- Overlay: {
9
- flex: 1,
10
- backgroundColor: 'rgba(0,0,0,0.6)',
11
- justifyContent: 'center',
12
- alignItems: 'center',
13
- },
14
- ModalWrapper: {
15
- backgroundColor: palette.base.white,
16
- alignItems: 'center',
17
- justifyContent: 'center',
18
- elevation: 12,
19
- minWidth: horizontalScale(50),
20
- marginHorizontal: horizontalScale(24),
21
- borderRadius: verticalScale(18),
22
- zIndex: 1,
23
- },
24
- Shadow: {
25
- shadowOffset: {
26
- width: 0,
27
- height: 2,
28
- },
29
- shadowOpacity: 0.25,
30
- },
31
- FullScreen: {
32
- position: 'absolute',
33
- top: 0,
34
- bottom: 0,
35
- left: 0,
36
- right: 0,
37
- backgroundColor: palette.base.white,
38
- zIndex: 2,
39
- },
40
- HeaderWrapper: {
41
- flexDirection: 'row',
42
- justifyContent: 'flex-end',
43
- alignItems: 'center',
44
- zIndex: 3,
45
- minHeight: verticalScale(52),
46
- backgroundColor: palette.base.white,
47
- },
48
- CloseButton: {
49
- position: 'absolute',
50
- top: moderateScale(12),
51
- right: moderateScale(12),
52
- },
53
- });
54
- const Modal = forwardRef(({ children = null, oncloseCallback = undefined, showCloseButton = false, canClose = true, animationType = 'fade', transparent = true, fullScreen = false, modalContainerStyle = {}, ...props }, ref) => {
55
- const [isVisible, setIsVisible] = useState(false);
56
- const renderCloseButton = fullScreen && showCloseButton;
57
- const handleClose = () => {
58
- if (oncloseCallback) {
59
- oncloseCallback();
60
- }
61
- setIsVisible(false);
62
- };
63
- useImperativeHandle(ref, () => ({
64
- open: () => setIsVisible(true),
65
- close: () => setIsVisible(false),
66
- }));
67
- return (<NativeModal visible={isVisible} transparent={transparent} animationType={animationType} {...props} {...(canClose && {
68
- onRequestClose: handleClose,
69
- })}>
70
- <View style={styles.Overlay}>
71
- {!fullScreen && (<Pressable style={StyleSheet.absoluteFill} disabled={!canClose} onPress={handleClose}/>)}
72
- <View style={fullScreen
73
- ? styles.FullScreen
74
- : [styles.ModalWrapper, styles.Shadow, modalContainerStyle]}>
75
- {renderCloseButton && canClose && (<Pressable onPress={handleClose} style={styles.HeaderWrapper} accessibilityLabel="Close modal" accessibilityRole="button">
76
- <Icon name="cross_light" size={24} color={palette.black.main} style={styles.CloseButton}/>
77
- </Pressable>)}
78
- {children}
79
- </View>
80
- </View>
81
- </NativeModal>);
82
- });
83
- export default Modal;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { ViewStyle } from 'react-native';
3
- declare const checkLocation: readonly ["left", "right"];
4
- type positions = (typeof checkLocation)[number];
5
- declare const CheckSizeValues: {
6
- sm: number;
7
- md: number;
8
- lg: number;
9
- };
10
- type sizeType = typeof CheckSizeValues;
11
- type sizeKeys = keyof sizeType;
12
- interface RadioButtonProps {
13
- children?: React.ReactNode | string;
14
- selected?: boolean;
15
- onPress?: () => {};
16
- checkPosition?: positions;
17
- disabled?: boolean;
18
- checkSize?: sizeKeys;
19
- style?: ViewStyle;
20
- }
21
- declare const RadioButton: ({ children, onPress, selected, checkPosition, checkSize, disabled, style, ...props }: RadioButtonProps) => React.JSX.Element;
22
- export default RadioButton;
@@ -1,49 +0,0 @@
1
- import React from 'react';
2
- import { View, TouchableOpacity, StyleSheet } from 'react-native';
3
- import Typography from '../Typography';
4
- import CheckBox from '../CheckBox';
5
- import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
6
- const checkLocation = ['left', 'right'];
7
- const CheckSizeValues = {
8
- sm: 16,
9
- md: 24,
10
- lg: 32,
11
- };
12
- const validPaddingHorizontal = scaledForDevice(16, horizontalScale);
13
- const validMarginVertical = scaledForDevice(10, moderateScale);
14
- const validMarginHorizontal = scaledForDevice(15, horizontalScale);
15
- const styles = StyleSheet.create({
16
- container: {
17
- alignItems: 'center',
18
- paddingHorizontal: validPaddingHorizontal,
19
- marginVertical: validMarginVertical,
20
- height: 'auto',
21
- },
22
- row: {
23
- flexDirection: 'row',
24
- justifyContent: 'space-between',
25
- },
26
- reverseRow: {
27
- flexDirection: 'row-reverse',
28
- justifyContent: 'space-between',
29
- },
30
- checkToLeft: {
31
- marginLeft: validMarginHorizontal,
32
- },
33
- checkToRight: {
34
- marginRight: validMarginHorizontal,
35
- },
36
- });
37
- const RadioButton = ({ children, onPress, selected = false, checkPosition = 'left', checkSize = 'sm', disabled = false, style, ...props }) => {
38
- const { container, row, reverseRow, checkToLeft, checkToRight } = styles;
39
- const isStringChild = typeof children === 'string';
40
- const checkLeft = checkPosition === 'left';
41
- const customSize = CheckSizeValues[checkSize];
42
- return (<TouchableOpacity style={[container, checkLeft ? row : reverseRow, style]} disabled={disabled} onPress={onPress} {...props}>
43
- <CheckBox checked={selected} disabled={disabled} customSize={customSize} borderRadius={customSize / 2} onPress={onPress}/>
44
- <View style={checkLeft ? checkToLeft : checkToRight}>
45
- {children && (isStringChild ? <Typography>{children}</Typography> : children)}
46
- </View>
47
- </TouchableOpacity>);
48
- };
49
- export default RadioButton;
@@ -1,8 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { ViewProps } from 'react-native';
3
- interface StatusChipProps extends ViewProps {
4
- children?: ReactElement | string;
5
- background?: string;
6
- }
7
- declare const StatusChip: ({ children, ...props }: StatusChipProps) => React.JSX.Element | null;
8
- export default StatusChip;
@@ -1,44 +0,0 @@
1
- import React, { isValidElement } from 'react';
2
- import { StyleSheet, View } from 'react-native';
3
- import { base, grey, primary } from '../../../theme/palette';
4
- import Typography from '../Typography';
5
- import { horizontalScale, moderateScale, scaledForDevice } from '../../../scale';
6
- const validHeight = scaledForDevice(24, moderateScale);
7
- const validPadding = scaledForDevice(12, horizontalScale);
8
- const validBorderRadius = scaledForDevice(12, moderateScale);
9
- const validBorderWidth = scaledForDevice(1, moderateScale);
10
- const validFontSize = scaledForDevice(13, moderateScale);
11
- const validLineHeight = scaledForDevice(18, moderateScale);
12
- const styles = ({ background }) => StyleSheet.create({
13
- ViewStyles: {
14
- height: validHeight,
15
- flexDirection: 'row',
16
- alignItems: 'center',
17
- paddingLeft: validPadding,
18
- paddingRight: validPadding,
19
- borderRadius: validBorderRadius,
20
- backgroundColor: background ?? base.white,
21
- borderWidth: validBorderWidth,
22
- borderColor: background ?? grey['300'],
23
- },
24
- TextStyles: {
25
- fontSize: validFontSize,
26
- lineHeight: validLineHeight,
27
- fontFamily: 'Roboto',
28
- fontWeight: '900',
29
- textAlign: 'center',
30
- color: background ? base.white : primary.main,
31
- },
32
- });
33
- const StatusChip = ({ children, ...props }) => {
34
- const isChildrenAString = typeof children === 'string';
35
- const isCustomComponent = isValidElement(children);
36
- const hasToRenderStatusChip = !children || (!isChildrenAString && !isCustomComponent);
37
- if (hasToRenderStatusChip) {
38
- return null;
39
- }
40
- return (<View style={styles(props).ViewStyles} {...props}>
41
- {isCustomComponent ? (children) : (<Typography style={styles(props).TextStyles}>{children}</Typography>)}
42
- </View>);
43
- };
44
- export default StatusChip;