@momo-kits/foundation 1.0.5 → 1.0.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.
@@ -1,3 +1,5 @@
1
+ import {Platform} from 'react-native';
2
+
1
3
  const Colors = {
2
4
  black_01: '#ffffff',
3
5
  black_02: '#f9f9f9',
@@ -161,4 +163,52 @@ const Radius = {
161
163
  XL: 24,
162
164
  };
163
165
 
164
- export {Colors, Spacing, Radius};
166
+ const Shadow = {
167
+ Dark: Platform.select({
168
+ ios: {
169
+ shadowColor: Colors.black_17,
170
+ shadowOffset: {
171
+ width: 2,
172
+ height: 2,
173
+ },
174
+ shadowOpacity: 0.25,
175
+ shadowRadius: 10,
176
+ },
177
+ android: {
178
+ shadowColor: Colors.black_20,
179
+ shadowOffset: {
180
+ width: 0,
181
+ height: 3,
182
+ },
183
+ shadowOpacity: 0.29,
184
+ shadowRadius: 4.65,
185
+
186
+ elevation: 7,
187
+ },
188
+ }),
189
+
190
+ Light: Platform.select({
191
+ ios: {
192
+ shadowColor: Colors.black_17,
193
+ shadowOffset: {
194
+ width: 2,
195
+ height: 2,
196
+ },
197
+ shadowOpacity: 0.07,
198
+ shadowRadius: 10,
199
+ },
200
+ android: {
201
+ shadowColor: Colors.black_10,
202
+ shadowOffset: {
203
+ width: 1,
204
+ height: 3,
205
+ },
206
+ shadowOpacity: 0.29,
207
+ shadowRadius: 4.65,
208
+
209
+ elevation: 6,
210
+ },
211
+ }),
212
+ };
213
+
214
+ export {Colors, Spacing, Radius, Shadow};
@@ -0,0 +1,19 @@
1
+ import React, {useContext} from 'react';
2
+ import {View} from 'react-native';
3
+ import {ApplicationContext} from '../Navigation';
4
+
5
+ const Divider = () => {
6
+ const {theme} = useContext(ApplicationContext);
7
+
8
+ return (
9
+ <View
10
+ style={{
11
+ height: 1,
12
+ width: '100%',
13
+ backgroundColor: theme.colors.border.default,
14
+ }}
15
+ />
16
+ );
17
+ };
18
+
19
+ export {Divider};
package/Input/styles.ts CHANGED
@@ -55,6 +55,7 @@ export default StyleSheet.create({
55
55
  },
56
56
  inputWrapper: {
57
57
  flexDirection: 'row',
58
+ marginTop: Spacing.S,
58
59
  },
59
60
 
60
61
  //text area style
@@ -7,7 +7,7 @@ import {Colors, Radius, Spacing} from '../Consts';
7
7
  import {ApplicationContext} from '../Navigation';
8
8
  import {ScreenSection, SectionItem} from '../Layout';
9
9
  import {Icon, IconSources} from '../Icon';
10
- import {SearchInput} from '../Input';
10
+ import {string} from 'prop-types';
11
11
 
12
12
  const ChooseOptionScreen = (
13
13
  data: string[] = [],
@@ -15,22 +15,14 @@ const ChooseOptionScreen = (
15
15
  onPress: (value: string) => void,
16
16
  ) => {
17
17
  const {theme} = useContext(ApplicationContext);
18
- const [searchTerm, setSearchTerm] = useState('');
19
- const [filteredData, setFilteredData] = useState<string[]>([]);
20
-
21
- useEffect(() => {
22
- let mapData = data;
23
- if (optionType === 'color') {
24
- mapData = Object.values(Colors);
25
- }
26
- if (optionType === 'icon') {
27
- mapData = Object.keys(IconSources);
28
- }
29
-
30
- setFilteredData(mapData);
31
- return () => {};
32
- }, [filteredData]);
33
18
 
19
+ let mapData = data;
20
+ if (optionType === 'color') {
21
+ mapData = Object.values(Colors);
22
+ }
23
+ if (optionType === 'icon') {
24
+ mapData = Object.keys(IconSources);
25
+ }
34
26
  const renderItemView = (item: string) => {
35
27
  switch (optionType) {
36
28
  case 'color': {
@@ -52,13 +44,6 @@ const ChooseOptionScreen = (
52
44
  }
53
45
  };
54
46
 
55
- const onSearch = (text: string) => {
56
- let newData = filteredData.map(i => i.includes(text));
57
- if (text === '') {
58
- newData = mapData;
59
- }
60
- };
61
-
62
47
  const renderItem = ({item, index}) => {
63
48
  const iconSource: {[key: string]: {uri: string}} = IconSources;
64
49
  let key = item;
@@ -73,7 +58,7 @@ const ChooseOptionScreen = (
73
58
  flexDirection: 'row',
74
59
  alignItems: 'center',
75
60
  marginBottom: Spacing.M,
76
- borderBottomWidth: index !== filteredData.length - 1 ? 1 : 0,
61
+ borderBottomWidth: index !== mapData.length - 1 ? 1 : 0,
77
62
  borderColor: theme.colors.border.default,
78
63
  paddingBottom: Spacing.M,
79
64
  }}>
@@ -85,9 +70,8 @@ const ChooseOptionScreen = (
85
70
  return (
86
71
  <ScreenSection>
87
72
  <SectionItem widthSpan={12}>
88
- <SearchInput value={searchTerm} onChangeText={onSearch} />
89
73
  <FlatList
90
- data={filteredData}
74
+ data={mapData}
91
75
  renderItem={renderItem}
92
76
  keyExtractor={(item, index) => `${item.toString()} ${index}`}
93
77
  showsVerticalScrollIndicator={false}
@@ -154,11 +138,7 @@ const Playground: FC<PlaygroundProps> = ({params}) => {
154
138
  value={option}
155
139
  onChange={() => onChangeOptions(option, key)}
156
140
  groupValue={compProps?.[key]}
157
- style={{
158
- marginBottom: Spacing.S,
159
- marginRight: Spacing.M,
160
- width: '25%',
161
- }}
141
+ style={{marginBottom: Spacing.S}}
162
142
  />
163
143
  );
164
144
  })}
package/index.ts CHANGED
@@ -33,3 +33,4 @@ export * from './Radio/types';
33
33
  export * from './Switch';
34
34
  export * from './Switch/types';
35
35
  export * from './Input';
36
+ export * from './Divider';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {
package/Divider/index.js DELETED
@@ -1,43 +0,0 @@
1
- import React, {useContext} from 'react';
2
- import {View} from 'react-native';
3
- import PropTypes from 'prop-types';
4
- import {ApplicationContext} from '@components';
5
- import styles from './styles';
6
-
7
- const Index = props => {
8
- const {theme} = useContext(ApplicationContext);
9
- const {color, thickness, direction} = props;
10
-
11
- let style = [
12
- styles.horizontal,
13
- {
14
- backgroundColor: color ?? theme.colors.border,
15
- height: thickness,
16
- },
17
- ];
18
-
19
- if (direction === 'vertical') {
20
- style = [
21
- styles.vertical,
22
- {
23
- backgroundColor: color ?? theme.colors.border,
24
- width: thickness,
25
- },
26
- ];
27
- }
28
- return <View style={style} />;
29
- };
30
-
31
- Index.propTypes = {
32
- color: PropTypes.string,
33
- thickness: PropTypes.number,
34
- direction: PropTypes.oneOf('horizontal', 'vertical'),
35
- };
36
-
37
- Index.defaultProps = {
38
- color: null,
39
- thickness: 1,
40
- direction: 'horizontal',
41
- };
42
-
43
- export default Index;
package/Divider/styles.js DELETED
@@ -1,10 +0,0 @@
1
- import {StyleSheet} from 'react-native';
2
-
3
- export default StyleSheet.create({
4
- horizontal: {
5
- width: '100%',
6
- },
7
- vertical: {
8
- height: '100%',
9
- },
10
- });