@janiscommerce/ui-native 1.10.2 → 1.11.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.
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextInput, TextInputProps } from 'react-native';
|
|
3
|
+
interface BaseInputProps extends TextInputProps {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
onChangeText?: (text: string) => void;
|
|
6
|
+
style?: any;
|
|
7
|
+
textAlign?: 'center' | 'left' | 'right' | undefined;
|
|
8
|
+
}
|
|
9
|
+
declare const BaseInput: React.ForwardRefExoticComponent<BaseInputProps & React.RefAttributes<TextInput>>;
|
|
10
|
+
export default BaseInput;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { StyleSheet, TextInput } from 'react-native';
|
|
3
|
+
import { palette } from '../../../theme/palette';
|
|
4
|
+
import { moderateScale, scaledForDevice } from '../../../scale';
|
|
5
|
+
const BaseInput = forwardRef(({ value, placeholder, onChangeText, style, textAlign, ...props }, ref) => {
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
input: {
|
|
8
|
+
padding: 0,
|
|
9
|
+
height: scaledForDevice(70, moderateScale),
|
|
10
|
+
borderColor: palette.primary.main,
|
|
11
|
+
borderWidth: 2,
|
|
12
|
+
borderRadius: 8,
|
|
13
|
+
fontSize: scaledForDevice(42, moderateScale),
|
|
14
|
+
backgroundColor: palette.white.light,
|
|
15
|
+
color: palette.black.main,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return (<TextInput style={[styles.input, style]} ref={ref} value={value} placeholder={placeholder} textAlign={textAlign || 'center'} onChangeText={onChangeText} selectionColor={palette.primary.main} placeholderTextColor={palette.grey[500]} {...props}/>);
|
|
19
|
+
});
|
|
20
|
+
export default BaseInput;
|
|
@@ -59,8 +59,8 @@ const Toast = ({ type, text1, text2, style, props }) => {
|
|
|
59
59
|
flexDirection: 'row',
|
|
60
60
|
alignItems: 'center',
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
closeIconWrapper: {
|
|
63
|
+
padding: scaledForDevice(10, moderateScale),
|
|
64
64
|
},
|
|
65
65
|
actionTitle: {
|
|
66
66
|
marginRight: scaledForDevice(5, moderateScale),
|
|
@@ -70,6 +70,9 @@ const Toast = ({ type, text1, text2, style, props }) => {
|
|
|
70
70
|
lineHeight: scaledForDevice(16, moderateScale),
|
|
71
71
|
color: validColor,
|
|
72
72
|
},
|
|
73
|
+
actionWrapper: {
|
|
74
|
+
padding: scaledForDevice(10, moderateScale),
|
|
75
|
+
},
|
|
73
76
|
});
|
|
74
77
|
return (<BaseToast type={type} style={[styles.container, style]}>
|
|
75
78
|
{showIcon && (<Icon name={selectedIconName} color={validColor} size={24} style={{ ...styles.icon, ...iconStyle }}/>)}
|
|
@@ -80,11 +83,11 @@ const Toast = ({ type, text1, text2, style, props }) => {
|
|
|
80
83
|
</View>
|
|
81
84
|
|
|
82
85
|
<View style={styles.feedbackWrapper}>
|
|
83
|
-
{actionTitle && (<TouchableOpacity onPress={handleActionCb} activeOpacity={0.6}>
|
|
86
|
+
{actionTitle && (<TouchableOpacity style={styles.actionWrapper} onPress={handleActionCb} activeOpacity={0.6}>
|
|
84
87
|
<Text style={styles.actionTitle}>{actionTitle}</Text>
|
|
85
88
|
</TouchableOpacity>)}
|
|
86
|
-
{showCloseIcon && (<TouchableOpacity onPress={handleCloseCb} activeOpacity={0.6}>
|
|
87
|
-
<Icon name="cross_light" color={validColor} size={24}
|
|
89
|
+
{showCloseIcon && (<TouchableOpacity style={styles.closeIconWrapper} onPress={handleCloseCb} activeOpacity={0.6}>
|
|
90
|
+
<Icon name="cross_light" color={validColor} size={24}/>
|
|
88
91
|
</TouchableOpacity>)}
|
|
89
92
|
</View>
|
|
90
93
|
</BaseToast>);
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import Svg from './components/atoms/Svg';
|
|
|
11
11
|
import SwipeUp from './components/atoms/SwipeUp';
|
|
12
12
|
import { SwipeUpFlatList, SwipeUpScrollView, SwipeUpView } from './components/atoms/SwipeUp/childComponents';
|
|
13
13
|
import Text from './components/atoms/Text';
|
|
14
|
+
import BaseInput from './components/atoms/BaseInput';
|
|
14
15
|
import Avatar from './components/molecules/Avatar';
|
|
15
16
|
import Button from './components/molecules/Button';
|
|
16
17
|
import Carousel from './components/molecules/Carousel';
|
|
@@ -27,4 +28,4 @@ import FullScreenMessage from './components/organisms/FullScreenMessage';
|
|
|
27
28
|
import SwipeItemSelectionList from './components/organisms/SwipeItemSelectionList';
|
|
28
29
|
import { palette } from './theme/palette';
|
|
29
30
|
import * as getScale from './scale';
|
|
30
|
-
export { Text, Avatar, CheckBox, Icon, Image, Loading, Svg, StatusChip, Input, palette, LoadingFullScreen, RadioButton, Select, SwipeUp, SwipeUpFlatList, SwipeUpScrollView, SwipeUpView, Carousel, ProgressBar, List, BaseButton, Button, getScale, LayoutWithBottomButtons, FullScreenMessage, Toast, configToast, SwipeList, ItemSelectionButton, SwipeItemSelectionList, MainCardList, };
|
|
31
|
+
export { Text, Avatar, CheckBox, Icon, Image, Loading, Svg, StatusChip, Input, palette, LoadingFullScreen, RadioButton, Select, SwipeUp, SwipeUpFlatList, SwipeUpScrollView, SwipeUpView, Carousel, ProgressBar, List, BaseButton, Button, getScale, LayoutWithBottomButtons, FullScreenMessage, Toast, configToast, SwipeList, ItemSelectionButton, SwipeItemSelectionList, MainCardList, BaseInput, };
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import Svg from './components/atoms/Svg';
|
|
|
12
12
|
import SwipeUp from './components/atoms/SwipeUp';
|
|
13
13
|
import { SwipeUpFlatList, SwipeUpScrollView, SwipeUpView } from './components/atoms/SwipeUp/childComponents';
|
|
14
14
|
import Text from './components/atoms/Text';
|
|
15
|
+
import BaseInput from './components/atoms/BaseInput';
|
|
15
16
|
// Molecules
|
|
16
17
|
import Avatar from './components/molecules/Avatar';
|
|
17
18
|
import Button from './components/molecules/Button';
|
|
@@ -31,4 +32,4 @@ import SwipeItemSelectionList from './components/organisms/SwipeItemSelectionLis
|
|
|
31
32
|
// Misc
|
|
32
33
|
import { palette } from './theme/palette';
|
|
33
34
|
import * as getScale from './scale';
|
|
34
|
-
export { Text, Avatar, CheckBox, Icon, Image, Loading, Svg, StatusChip, Input, palette, LoadingFullScreen, RadioButton, Select, SwipeUp, SwipeUpFlatList, SwipeUpScrollView, SwipeUpView, Carousel, ProgressBar, List, BaseButton, Button, getScale, LayoutWithBottomButtons, FullScreenMessage, Toast, configToast, SwipeList, ItemSelectionButton, SwipeItemSelectionList, MainCardList, };
|
|
35
|
+
export { Text, Avatar, CheckBox, Icon, Image, Loading, Svg, StatusChip, Input, palette, LoadingFullScreen, RadioButton, Select, SwipeUp, SwipeUpFlatList, SwipeUpScrollView, SwipeUpView, Carousel, ProgressBar, List, BaseButton, Button, getScale, LayoutWithBottomButtons, FullScreenMessage, Toast, configToast, SwipeList, ItemSelectionButton, SwipeItemSelectionList, MainCardList, BaseInput, };
|