@holper/react-native-holper-storybook 0.6.27 → 0.6.28

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.
@@ -1,10 +1,8 @@
1
- import React from "react";
1
+ import React, { useState } from "react";
2
2
  import { View } from "react-native";
3
3
  import PropTypes from "prop-types";
4
- import Picker from "react-native-picker-select";
5
- import Ionicons from "react-native-vector-icons/Ionicons";
6
- import { Colors } from "../../configs/constants";
7
- import style from "./style";
4
+ import DropDownPicker from "react-native-dropdown-picker";
5
+ import style, { fontStyle, includesSelect, touchable } from "./style";
8
6
 
9
7
  const Select = ({
10
8
  value,
@@ -14,34 +12,38 @@ const Select = ({
14
12
  disabled,
15
13
  fitToContainer,
16
14
  placeholder,
17
- }) => (
18
- <View
19
- style={[
20
- style.container,
21
- disabled ? style.disabled : {},
22
- fitToContainer ? style.fit : {},
23
- ]}
24
- >
25
- <Picker
26
- style={includesSelect[variant]}
27
- placeholder={{ label: placeholder }}
28
- value={value}
29
- onValueChange={onValueChange}
30
- placeholderTextColor={Colors.midblue}
31
- useNativeAndroidPickerStyle={false}
32
- items={items}
33
- disabled={disabled}
34
- Icon={() => (
35
- <Ionicons
36
- name="chevron-down-outline"
37
- size={20}
38
- style={style.selectIcon}
39
- color={Colors.darkgray}
40
- />
41
- )}
42
- />
43
- </View>
44
- );
15
+ }) => {
16
+ const [open, setOpen] = useState(true);
17
+
18
+ return (
19
+ <View
20
+ style={[
21
+ style.container,
22
+ disabled ? style.disabled : {},
23
+ fitToContainer ? style.fit : {},
24
+ { zIndex: open ? 1 : 0 },
25
+ ]}
26
+ >
27
+ <DropDownPicker
28
+ style={includesSelect[variant]}
29
+ open={open}
30
+ value={value}
31
+ items={items}
32
+ setOpen={setOpen}
33
+ setValue={onValueChange}
34
+ disabled={disabled}
35
+ placeholder={placeholder}
36
+ placeholderStyle={fontStyle}
37
+ listItemLabelStyle={fontStyle}
38
+ textStyle={fontStyle}
39
+ dropDownContainerStyle={{
40
+ ...includesSelect[variant],
41
+ height: "auto",
42
+ }}
43
+ />
44
+ </View>
45
+ );
46
+ };
45
47
 
46
48
  Select.defaultProps = {
47
49
  variant: "default",
@@ -68,51 +70,4 @@ Select.propTypes = {
68
70
  ),
69
71
  };
70
72
 
71
- const basicStyle = {
72
- height: 50,
73
- width: "100%",
74
- borderRadius: 25,
75
- borderWidth: 1,
76
- paddingHorizontal: 20,
77
- color: Colors.darkblue,
78
- fontFamily: "poppins_regular",
79
- backgroundColor: Colors.white,
80
- marginVertical: 6,
81
- };
82
-
83
- const includesSelect = {
84
- default: {
85
- inputIOS: {
86
- ...basicStyle,
87
- borderColor: Colors.lightblue,
88
- },
89
- inputAndroid: {
90
- ...basicStyle,
91
- borderColor: Colors.lightblue,
92
- },
93
- },
94
- completed: {
95
- inputIOS: {
96
- ...basicStyle,
97
- borderColor: Colors.green,
98
- },
99
- inputAndroid: {
100
- ...basicStyle,
101
- borderColor: Colors.green,
102
- },
103
- },
104
- error: {
105
- inputIOS: {
106
- ...basicStyle,
107
- borderColor: Colors.red,
108
- color: Colors.red,
109
- },
110
- inputAndroid: {
111
- ...basicStyle,
112
- borderColor: Colors.red,
113
- color: Colors.red,
114
- },
115
- },
116
- };
117
-
118
73
  export default Select;
@@ -1,21 +1,54 @@
1
- import { Dimensions } from 'react-native';
1
+ import { Dimensions } from "react-native";
2
+ import { Colors } from "../../configs/constants";
2
3
 
3
- const { width } = Dimensions.get('window');
4
+ const { width } = Dimensions.get("window");
4
5
 
5
6
  export default {
6
7
  container: {
7
8
  width: width - 80,
8
- position: 'relative'
9
+ position: "relative",
9
10
  },
10
11
  fit: {
11
- width: '100%',
12
- position: 'relative'
12
+ width: "100%",
13
+ position: "relative",
13
14
  },
14
15
  selectIcon: {
15
16
  marginTop: 20,
16
- marginRight: 15
17
+ marginRight: 15,
17
18
  },
18
19
  disabled: {
19
- opacity: 0.5
20
- }
20
+ opacity: 0.5,
21
+ },
22
+ };
23
+
24
+ export const fontStyle = {
25
+ color: Colors.darkblue,
26
+ fontFamily: "poppins_regular",
27
+ };
28
+
29
+ const basicStyle = {
30
+ height: 50,
31
+ width: "100%",
32
+ borderRadius: 25,
33
+ borderWidth: 1,
34
+ paddingHorizontal: 20,
35
+ backgroundColor: Colors.white,
36
+ marginVertical: 6,
37
+ ...fontStyle,
38
+ };
39
+
40
+ export const includesSelect = {
41
+ default: {
42
+ ...basicStyle,
43
+ borderColor: Colors.lightblue,
44
+ },
45
+ completed: {
46
+ ...basicStyle,
47
+ borderColor: Colors.green,
48
+ },
49
+ error: {
50
+ ...basicStyle,
51
+ borderColor: Colors.red,
52
+ color: Colors.red,
53
+ },
21
54
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "main": "lib/index.js",
3
3
  "name": "@holper/react-native-holper-storybook",
4
4
  "description": "A component library for Holper projects",
5
- "version": "0.6.27",
5
+ "version": "0.6.28",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "lib",
@@ -28,7 +28,6 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@react-native-async-storage/async-storage": "1.17.11",
31
- "@react-native-picker/picker": "2.4.8",
32
31
  "deprecated-react-native-prop-types": "^2.3.0",
33
32
  "expo": "^48.0.6",
34
33
  "expo-asset": "~8.9.1",
@@ -42,11 +41,11 @@
42
41
  "prop-types": "^15.8.1",
43
42
  "react": "18.2.0",
44
43
  "react-dom": "18.2.0",
45
- "react-native": "0.71.6",
44
+ "react-native": "0.71.7",
46
45
  "react-native-countdown-circle-timer": "^3.0.9",
47
46
  "react-native-deck-swiper": "^2.0.5",
47
+ "react-native-dropdown-picker": "^5.4.6",
48
48
  "react-native-flash-message": "^0.2.1",
49
- "react-native-picker-select": "^8.0.4",
50
49
  "react-native-safe-area-context": "4.5.0",
51
50
  "react-native-status-bar-height": "^2.6.0",
52
51
  "react-native-svg": "13.4.0",