vpt-sebraeds 0.0.71 → 0.0.72

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,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Text, Image, TouchableOpacity, Platform, StyleSheet } from 'react-native';
2
+ import { View, Text, Image, TouchableOpacity, Pressable, Platform, StyleSheet } from 'react-native';
3
3
  import RemixIcon from 'react-native-remix-icon';
4
4
  import { fontFamily } from '../utils/fontFamily';
5
5
 
@@ -25,6 +25,7 @@ import { fontFamily } from '../utils/fontFamily';
25
25
  * @param {boolean} bookmarked - Estado do bookmark (ícone preenchido ou não)
26
26
  * @param {function} onPress - Callback ao pressionar o card
27
27
  * @param {function} onBookmarkPress - Callback ao pressionar o bookmark
28
+ * @param {function} onLongPress - Callback ao pressionar e segurar o card (long press)
28
29
  * @param {function} onArrowPress - Callback ao pressionar a seta
29
30
  * @param {object} style - Estilo customizado do container
30
31
  */
@@ -37,6 +38,7 @@ const ListItem = ({
37
38
  showBookmark = true,
38
39
  showArrow = true,
39
40
  onPress,
41
+ onLongPress,
40
42
  onBookmarkPress,
41
43
  onArrowPress,
42
44
  style,
@@ -50,11 +52,12 @@ const ListItem = ({
50
52
  : '#FFFFFF';
51
53
 
52
54
  return (
53
- <TouchableOpacity
54
- activeOpacity={1}
55
+ <Pressable
55
56
  onPressIn={() => setPressed(true)}
56
57
  onPressOut={() => setPressed(false)}
57
58
  onPress={onPress}
59
+ onLongPress={onLongPress}
60
+ delayLongPress={500}
58
61
  style={[styles.container, { backgroundColor }, style]}
59
62
  >
60
63
  {/* Thumbnail */}
@@ -118,7 +121,7 @@ const ListItem = ({
118
121
  )}
119
122
  </View>
120
123
  </View>
121
- </TouchableOpacity>
124
+ </Pressable>
122
125
  );
123
126
  };
124
127
 
@@ -21,9 +21,10 @@ export default ListItem;
21
21
  * @param {boolean} bookmarked - Estado do bookmark (ícone preenchido ou não)
22
22
  * @param {function} onPress - Callback ao pressionar o card
23
23
  * @param {function} onBookmarkPress - Callback ao pressionar o bookmark
24
+ * @param {function} onLongPress - Callback ao pressionar e segurar o card (long press)
24
25
  * @param {function} onArrowPress - Callback ao pressionar a seta
25
26
  * @param {object} style - Estilo customizado do container
26
27
  */
27
- declare function ListItem({ title, descriptions, imageSource, selected, bookmarked, showBookmark, showArrow, onPress, onBookmarkPress, onArrowPress, style, }: string): React.JSX.Element;
28
+ declare function ListItem({ title, descriptions, imageSource, selected, bookmarked, showBookmark, showArrow, onPress, onLongPress, onBookmarkPress, onArrowPress, style, }: string): React.JSX.Element;
28
29
  import React from 'react';
29
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/ListItem/index.jsx"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,+JAVW,MAAM,qBAsGhB;kBA1H+B,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/ListItem/index.jsx"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,4KAXW,MAAM,qBAyGhB;kBA7H+B,OAAO"}
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Text, Image, TouchableOpacity, Platform, StyleSheet } from 'react-native';
2
+ import { View, Text, Image, TouchableOpacity, Pressable, Platform, StyleSheet } from 'react-native';
3
3
  import RemixIcon from 'react-native-remix-icon';
4
4
  import { fontFamily } from '../utils/fontFamily';
5
5
  /**
@@ -24,17 +24,18 @@ import { fontFamily } from '../utils/fontFamily';
24
24
  * @param {boolean} bookmarked - Estado do bookmark (ícone preenchido ou não)
25
25
  * @param {function} onPress - Callback ao pressionar o card
26
26
  * @param {function} onBookmarkPress - Callback ao pressionar o bookmark
27
+ * @param {function} onLongPress - Callback ao pressionar e segurar o card (long press)
27
28
  * @param {function} onArrowPress - Callback ao pressionar a seta
28
29
  * @param {object} style - Estilo customizado do container
29
30
  */
30
- const ListItem = ({ title = '', descriptions = [], imageSource, selected = false, bookmarked = false, showBookmark = true, showArrow = true, onPress, onBookmarkPress, onArrowPress, style, }) => {
31
+ const ListItem = ({ title = '', descriptions = [], imageSource, selected = false, bookmarked = false, showBookmark = true, showArrow = true, onPress, onLongPress, onBookmarkPress, onArrowPress, style, }) => {
31
32
  const [pressed, setPressed] = useState(false);
32
33
  const backgroundColor = selected
33
34
  ? '#E3E9FF'
34
35
  : pressed
35
36
  ? '#E3E9FF'
36
37
  : '#FFFFFF';
37
- return (<TouchableOpacity activeOpacity={1} onPressIn={() => setPressed(true)} onPressOut={() => setPressed(false)} onPress={onPress} style={[styles.container, { backgroundColor }, style]}>
38
+ return (<Pressable onPressIn={() => setPressed(true)} onPressOut={() => setPressed(false)} onPress={onPress} onLongPress={onLongPress} delayLongPress={500} style={[styles.container, { backgroundColor }, style]}>
38
39
  {/* Thumbnail */}
39
40
  <View style={styles.imageWrapper}>
40
41
  {imageSource ? (<Image source={imageSource} style={styles.image} resizeMode="cover"/>) : (<View style={styles.imagePlaceholder}/>)}
@@ -70,7 +71,7 @@ const ListItem = ({ title = '', descriptions = [], imageSource, selected = false
70
71
  </TouchableOpacity>) : (<View />)}
71
72
  </View>
72
73
  </View>
73
- </TouchableOpacity>);
74
+ </Pressable>);
74
75
  };
75
76
  const styles = StyleSheet.create({
76
77
  container: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpt-sebraeds",
3
- "version": "0.0.71",
3
+ "version": "0.0.72",
4
4
  "description": "Biblioteca de componentes React Native do Sebrae",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",