@janiscommerce/ui-native 1.10.3 → 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;
|
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, };
|