vpt-sebraeds 0.0.47 → 0.0.48

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.
Files changed (29) hide show
  1. package/components/FilterableMultiSelect/index.jsx +89 -133
  2. package/components/SEIcon/CustomIcon/boletoDasMei.jsx +1 -1
  3. package/components/SEIcon/CustomIcon/calculadoraPrecoIdeal.jsx +1 -1
  4. package/components/SEIcon/CustomIcon/calculadoraValuation.jsx +1 -1
  5. package/components/SEIcon/CustomIcon/capacidadePagamento.jsx +1 -1
  6. package/components/SEIcon/CustomIcon/capitalGiro.jsx +1 -1
  7. package/components/SEIcon/CustomIcon/catalogoFornecedores.jsx +1 -1
  8. package/components/SEIcon/CustomIcon/creditoPermutas.jsx +1 -1
  9. package/components/SEIcon/CustomIcon/dataValidadeEpi.jsx +1 -1
  10. package/components/SEIcon/CustomIcon/diagnosticoEstrategico.jsx +1 -1
  11. package/components/SEIcon/CustomIcon/dominandoRedesSociais.jsx +1 -1
  12. package/components/SEIcon/CustomIcon/empresaGoogle.jsx +1 -1
  13. package/components/SEIcon/CustomIcon/fluxoCaixa.jsx +1 -1
  14. package/components/SEIcon/CustomIcon/fornecedoresTi.jsx +1 -1
  15. package/components/SEIcon/CustomIcon/geradoresIdeiasIA.jsx +1 -1
  16. package/components/SEIcon/CustomIcon/gestaoAgendamento.jsx +1 -1
  17. package/components/SEIcon/CustomIcon/impostoMei.jsx +1 -1
  18. package/components/SEIcon/CustomIcon/indicadoresMercado.jsx +1 -1
  19. package/components/SEIcon/CustomIcon/listaEpi.jsx +1 -1
  20. package/components/SEIcon/CustomIcon/lucroPotencial.jsx +1 -1
  21. package/components/SEIcon/CustomIcon/melhoresRegioesComerciais.jsx +1 -1
  22. package/components/SEIcon/CustomIcon/ncmComCodigoDeBarras.jsx +1 -1
  23. package/components/SEIcon/CustomIcon/postsInteligentes.jsx +1 -1
  24. package/components/SEIcon/CustomIcon/sebraeConecta.jsx +1 -1
  25. package/components/SEIcon/CustomIcon/segurancaTrabalho.jsx +1 -1
  26. package/components/SEIcon/CustomIcon/simuladorEmprestimo.jsx +1 -1
  27. package/dist/components/FilterableMultiSelect/index.d.ts.map +1 -1
  28. package/dist/components/FilterableMultiSelect/index.js +67 -95
  29. package/package.json +1 -1
@@ -1,31 +1,19 @@
1
- import React, { useState } from 'react';
2
- import { View, TextInput, StyleSheet, TouchableOpacity, Platform } from 'react-native';
3
- import SelectItem from '../SelectItem';
1
+ import React, { useState, useRef } from 'react';
2
+ import {
3
+ View,
4
+ TextInput,
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ Platform,
8
+ Keyboard,
9
+ TouchableWithoutFeedback
10
+ } from 'react-native';
4
11
  import Icon from '../Icon';
5
- import ScrollBar from '../ScrollBar';
6
12
  import SEText from '../SEText';
13
+ import ScrollBar from '../ScrollBar';
14
+ import { set } from 'lodash';
7
15
 
8
16
  const CustomCheckbox = ({ selected, iconColor, size = 21 }) => {
9
- if (selected) {
10
- return (
11
- <View style={{
12
- width: size,
13
- height: size,
14
- borderWidth: 1.5,
15
- borderColor: iconColor,
16
- borderRadius: 4,
17
- backgroundColor: iconColor,
18
- alignItems: 'center',
19
- justifyContent: 'center',
20
- }}>
21
- <Icon
22
- name="check-line"
23
- size={size - 8}
24
- color="#FFFFFF"
25
- />
26
- </View>
27
- );
28
- }
29
17
  return (
30
18
  <View style={{
31
19
  width: size,
@@ -33,8 +21,12 @@ const CustomCheckbox = ({ selected, iconColor, size = 21 }) => {
33
21
  borderWidth: 1.5,
34
22
  borderColor: iconColor,
35
23
  borderRadius: 4,
36
- backgroundColor: 'transparent',
37
- }} />
24
+ backgroundColor: selected ? iconColor : 'transparent',
25
+ alignItems: 'center',
26
+ justifyContent: 'center',
27
+ }}>
28
+ {selected && <Icon name="check-line" size={size - 8} color="#FFFFFF" />}
29
+ </View>
38
30
  );
39
31
  };
40
32
 
@@ -48,6 +40,10 @@ const FilterableMultiSelect = ({
48
40
  }) => {
49
41
  const [search, setSearch] = useState(searchedValue);
50
42
  const [isFocused, setIsFocused] = useState(false);
43
+ const [onPressIn, setOnPressIn] = useState(false);
44
+
45
+ // 1. Criamos uma referência para o input
46
+ const inputRef = useRef(null);
51
47
 
52
48
  const handleSearch = (value) => {
53
49
  setSearch(value);
@@ -59,31 +55,35 @@ const FilterableMultiSelect = ({
59
55
  onSearch('');
60
56
  };
61
57
 
62
- const isActive = isFocused || search.length > 0;
58
+ // 2. Função para fechar o teclado e tirar o foco
59
+ const dismissAll = () => {
60
+ Keyboard.dismiss();
61
+ inputRef.current?.blur();
62
+ };
63
63
 
64
- // Filtrar opções baseado na busca
65
64
  const filteredOptions = options.filter(option =>
66
65
  option.label.toLowerCase().includes(search.toLowerCase())
67
66
  );
68
67
 
69
68
  return (
70
- <View style={styles.container}>
71
- <View>
69
+ /* 3. O TouchableWithoutFeedback aqui garante que o clique fora feche o teclado */
70
+ <TouchableWithoutFeedback onPress={dismissAll}>
71
+ <View style={styles.container}>
72
72
  <View style={[
73
73
  styles.inputWrapper,
74
- isActive && styles.inputWrapperActive
74
+ isFocused && styles.inputWrapperActive,
75
+ onPressIn && styles.inputOnpressIn
75
76
  ]}>
76
77
  <View style={styles.searchIconWrapper}>
77
- <Icon
78
- name="search-line"
79
- size={16}
80
- color="#687499"
81
- />
78
+ <Icon name="search-line" size={16} color="#687499" />
82
79
  </View>
83
80
  <TextInput
84
- style={[styles.input, isActive && styles.inputActive]}
81
+ ref={inputRef} // Atribuindo a ref
82
+ style={[styles.input, search.length > 0 && styles.inputActive]}
85
83
  value={search}
86
84
  onChangeText={handleSearch}
85
+ onPressIn={()=> setOnPressIn(true)}
86
+ onPressOut={()=> setOnPressIn(false)}
87
87
  onFocus={() => setIsFocused(true)}
88
88
  onBlur={() => setIsFocused(false)}
89
89
  placeholder={placeholder}
@@ -91,53 +91,32 @@ const FilterableMultiSelect = ({
91
91
  cursorColor="#1B244B"
92
92
  autoCorrect={false}
93
93
  underlineColorAndroid="transparent"
94
+ returnKeyType="done" // Muda o botão do teclado para "Concluído"
95
+ onSubmitEditing={dismissAll} // CORREÇÃO: Fecha o teclado no botão circulado
94
96
  />
95
- {isActive && (
96
- <TouchableOpacity
97
- onPress={handleClear}
98
- style={styles.clearIconWrapper}
99
- >
100
- <Icon
101
- name="close-line"
102
- size={14}
103
- color="#2A4FDA"
104
- />
97
+ {search.length > 0 && (
98
+ <TouchableOpacity onPress={handleClear} style={styles.clearIconWrapper}>
99
+ <Icon name="close-line" size={14} color="#2A4FDA" />
105
100
  </TouchableOpacity>
106
101
  )}
107
102
  </View>
108
- </View>
109
- <ScrollBar
110
- style={styles.scroll}
111
- barColor="#C9D5FF"
112
- barThickness={6}
113
- >
114
- <View style={{ paddingRight: 5 }}>
115
- {filteredOptions.length === 0 ? (
116
- <View style={styles.emptyContainer}>
117
- <SEText
118
- type="ns-sm-body-bold"
119
- style={styles.emptyTitle}
120
- >
121
- Nenhum resultado
122
- </SEText>
123
- <SEText
124
- type="ns-sm-body"
125
- style={styles.emptySubtitle}
126
- >
127
- Escreva palavras diferentes
128
- </SEText>
129
- </View>
130
- ) : (
131
- filteredOptions.map((option, idx) => (
132
- <View
133
- key={option.value}
134
- style={{
135
- width: '100%',
136
- // Adiciona marginBottom apenas se não for o último item
137
- marginBottom: idx === filteredOptions.length - 1 ? 0 : 8,
138
- }}
139
- >
103
+
104
+ <ScrollBar
105
+ style={styles.scroll}
106
+ barColor="#C9D5FF"
107
+ barThickness={6}
108
+ >
109
+ {/* 4. View de conteúdo com paddingBottom para não colar no teclado */}
110
+ <View style={{ paddingRight: 5, paddingBottom: 20 }}>
111
+ {filteredOptions.length === 0 ? (
112
+ <View style={styles.emptyContainer}>
113
+ <SEText type="ns-sm-body-bold" style={styles.emptyTitle}>Nenhum resultado</SEText>
114
+ <SEText type="ns-sm-body" style={styles.emptySubtitle}>Escreva palavras diferentes</SEText>
115
+ </View>
116
+ ) : (
117
+ filteredOptions.map((option, idx) => (
140
118
  <TouchableOpacity
119
+ key={option.value}
141
120
  style={{
142
121
  flexDirection: 'row',
143
122
  alignItems: 'center',
@@ -148,13 +127,17 @@ const FilterableMultiSelect = ({
148
127
  borderColor: selected.includes(option.value) ? '#2A4FDA' : '#E2E9FC',
149
128
  backgroundColor: selected.includes(option.value) ? '#E3E9FF' : '#FFFFFF',
150
129
  paddingHorizontal: 16,
130
+ marginBottom: 8,
131
+ }}
132
+ onPress={() => {
133
+ // 5. Opcional: Se quiser que o teclado feche ao selecionar
134
+ // dismissAll();
135
+ onSelect(option.value);
151
136
  }}
152
- disabled={option.disabled}
153
- onPress={() => onSelect(option.value)}
154
137
  >
155
138
  <CustomCheckbox
156
139
  selected={selected.includes(option.value)}
157
- iconColor={selected.includes(option.value) ? '#2A4FDA' : '#2A4FDA'}
140
+ iconColor={'#2A4FDA'}
158
141
  size={20}
159
142
  />
160
143
  <SEText
@@ -167,86 +150,59 @@ const FilterableMultiSelect = ({
167
150
  {option.label}
168
151
  </SEText>
169
152
  </TouchableOpacity>
170
- </View>
171
- ))
172
- )}
173
- </View>
174
- </ScrollBar>
175
- </View>
153
+ ))
154
+ )}
155
+ </View>
156
+ </ScrollBar>
157
+ </View>
158
+ </TouchableWithoutFeedback>
176
159
  );
177
160
  };
178
161
 
179
162
  const styles = StyleSheet.create({
180
163
  container: {
164
+ flex: 1,
181
165
  width: '100%',
182
- alignSelf: 'center',
183
166
  backgroundColor: '#fff',
184
- borderRadius: 8,
185
- padding: 0,
186
- flex: 1,
187
167
  },
188
168
  inputWrapper: {
189
- position: 'relative',
190
169
  flexDirection: 'row',
191
170
  alignItems: 'center',
192
171
  borderRadius: 8,
193
- borderWidth: 1.5,
194
- borderColor: '#C9D5FF',
172
+ borderWidth: 2,
173
+ borderColor: '#96ACFF',
195
174
  marginBottom: 24,
196
175
  height: 49,
197
176
  backgroundColor: '#FFFFFF',
198
177
  },
199
178
  inputWrapperActive: {
179
+ borderWidth: 2,
200
180
  borderColor: '#2A4FDA',
181
+ outlineColor: '#96ACFF',
182
+ outlineWidth: 3,
201
183
  },
202
- searchIconWrapper: {
203
- paddingLeft: 16,
204
- paddingBottom:2,
205
- },
206
- clearIconWrapper: {
207
- position: 'absolute',
208
- right: 16,
209
- top: 17,
184
+ inputOnpressIn:{
185
+ borderWidth: 2,
186
+ borderColor: '#2A4FDA',
210
187
  },
188
+ searchIconWrapper: { paddingLeft: 16 },
189
+ clearIconWrapper: { position: 'absolute', right: 16 },
211
190
  input: {
212
191
  flex: 1,
213
192
  height: '100%',
214
193
  paddingHorizontal: 12,
215
- paddingRight: 40,
194
+ fontSize: 16,
195
+ color: '#687499',
216
196
  ...Platform.select({
217
197
  ios: { fontFamily: 'Nunito Sans 10pt Regular' },
218
198
  android: { fontFamily: 'NunitoSans_10pt-Regular' },
219
199
  }),
220
- fontSize: 16,
221
- lineHeight: 24,
222
- letterSpacing: 0,
223
- color: '#687499',
224
- backgroundColor: 'transparent',
225
- },
226
- inputActive: {
227
- color: '#1B244B',
228
- },
229
- scroll: {
230
- zIndex : 1,
231
- paddingTop: 0,
232
- flex: 1,
233
- minHeight: 0,
234
- paddingRight: 5,
235
- },
236
- emptyContainer: {
237
- alignItems: 'center',
238
- justifyContent: 'center',
239
- paddingVertical: 12,
240
- },
241
- emptyTitle: {
242
- color: '#1B244B',
243
- fontSize: 16,
244
- marginBottom: 4,
245
- },
246
- emptySubtitle: {
247
- color: '#687499',
248
- fontSize: 14,
249
200
  },
201
+ inputActive: { color: '#1B244B' },
202
+ scroll: { flex: 1 },
203
+ emptyContainer: { alignItems: 'center', marginTop: 20 },
204
+ emptyTitle: { color: '#1B244B', fontSize: 16 },
205
+ emptySubtitle: { color: '#687499', fontSize: 14 },
250
206
  });
251
207
 
252
208
  export default FilterableMultiSelect;
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const boletoDasMei = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const CalculadoraPrecoIdeal = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const CalculadoraValuation = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const CapacidadePagamento = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const CapitalGiro = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const CatalogoFornecedores = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const CreditoPermutas = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const DataValidadeEpi = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const DiagnosticoEstrategico = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const DominandoRedesSociais = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const EmpresaGoogle = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const FluxoCaixa = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const FornecedoresTi = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const GeradoresIdeiasIA = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const GestaoAgendamento = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const ImpostoMei = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const IndicadoresMercado = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const ListaEpi = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const LucroPotencial = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const MelhoresRegioesComerciais = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const NcmComCodigoDeBarras = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const PostsInteligentes = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const SebraeConecta = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const SegurancaTrabalho = (props) => (
4
4
  <Svg
@@ -1,4 +1,4 @@
1
- import * as React from "react"
1
+ import * as React from "react"
2
2
  import Svg, { Path } from "react-native-svg"
3
3
  const SimuladorEmprestimo = (props) => (
4
4
  <Svg
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/FilterableMultiSelect/index.jsx"],"names":[],"mappings":";AAwCA;;;;;;;sBAwIC;kBAhL+B,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/FilterableMultiSelect/index.jsx"],"names":[],"mappings":";AAgCA;;;;;;;sBA+HC;kBA/JuC,OAAO"}
@@ -1,36 +1,29 @@
1
- import React, { useState } from 'react';
2
- import { View, TextInput, StyleSheet, TouchableOpacity, Platform } from 'react-native';
3
- import SelectItem from '../SelectItem';
1
+ import React, { useState, useRef } from 'react';
2
+ import { View, TextInput, StyleSheet, TouchableOpacity, Platform, Keyboard, TouchableWithoutFeedback } from 'react-native';
4
3
  import Icon from '../Icon';
5
- import ScrollBar from '../ScrollBar';
6
4
  import SEText from '../SEText';
5
+ import ScrollBar from '../ScrollBar';
6
+ import { set } from 'lodash';
7
7
  const CustomCheckbox = ({ selected, iconColor, size = 21 }) => {
8
- if (selected) {
9
- return (<View style={{
10
- width: size,
11
- height: size,
12
- borderWidth: 1.5,
13
- borderColor: iconColor,
14
- borderRadius: 4,
15
- backgroundColor: iconColor,
16
- alignItems: 'center',
17
- justifyContent: 'center',
18
- }}>
19
- <Icon name="check-line" size={size - 8} color="#FFFFFF"/>
20
- </View>);
21
- }
22
8
  return (<View style={{
23
9
  width: size,
24
10
  height: size,
25
11
  borderWidth: 1.5,
26
12
  borderColor: iconColor,
27
13
  borderRadius: 4,
28
- backgroundColor: 'transparent',
29
- }}/>);
14
+ backgroundColor: selected ? iconColor : 'transparent',
15
+ alignItems: 'center',
16
+ justifyContent: 'center',
17
+ }}>
18
+ {selected && <Icon name="check-line" size={size - 8} color="#FFFFFF"/>}
19
+ </View>);
30
20
  };
31
21
  const FilterableMultiSelect = ({ options = [], placeholder = 'O que você procura?', searchedValue = '', onSearch = () => { }, selected = [], onSelect = () => { }, }) => {
32
22
  const [search, setSearch] = useState(searchedValue);
33
23
  const [isFocused, setIsFocused] = useState(false);
24
+ const [onPressIn, setOnPressIn] = useState(false);
25
+ // 1. Criamos uma referência para o input
26
+ const inputRef = useRef(null);
34
27
  const handleSearch = (value) => {
35
28
  setSearch(value);
36
29
  onSearch(value);
@@ -39,39 +32,40 @@ const FilterableMultiSelect = ({ options = [], placeholder = 'O que você procur
39
32
  setSearch('');
40
33
  onSearch('');
41
34
  };
42
- const isActive = isFocused || search.length > 0;
43
- // Filtrar opções baseado na busca
35
+ // 2. Função para fechar o teclado e tirar o foco
36
+ const dismissAll = () => {
37
+ Keyboard.dismiss();
38
+ inputRef.current?.blur();
39
+ };
44
40
  const filteredOptions = options.filter(option => option.label.toLowerCase().includes(search.toLowerCase()));
45
- return (<View style={styles.container}>
46
- <View>
41
+ return (
42
+ /* 3. O TouchableWithoutFeedback aqui garante que o clique fora feche o teclado */
43
+ <TouchableWithoutFeedback onPress={dismissAll}>
44
+ <View style={styles.container}>
47
45
  <View style={[
48
46
  styles.inputWrapper,
49
- isActive && styles.inputWrapperActive
47
+ isFocused && styles.inputWrapperActive,
48
+ onPressIn && styles.inputOnpressIn
50
49
  ]}>
51
50
  <View style={styles.searchIconWrapper}>
52
51
  <Icon name="search-line" size={16} color="#687499"/>
53
52
  </View>
54
- <TextInput style={[styles.input, isActive && styles.inputActive]} value={search} onChangeText={handleSearch} onFocus={() => setIsFocused(true)} onBlur={() => setIsFocused(false)} placeholder={placeholder} placeholderTextColor="#687499" cursorColor="#1B244B" autoCorrect={false} underlineColorAndroid="transparent"/>
55
- {isActive && (<TouchableOpacity onPress={handleClear} style={styles.clearIconWrapper}>
53
+ <TextInput ref={inputRef} // Atribuindo a ref
54
+ style={[styles.input, search.length > 0 && styles.inputActive]} value={search} onChangeText={handleSearch} onPressIn={() => setOnPressIn(true)} onPressOut={() => setOnPressIn(false)} onFocus={() => setIsFocused(true)} onBlur={() => setIsFocused(false)} placeholder={placeholder} placeholderTextColor="#687499" cursorColor="#1B244B" autoCorrect={false} underlineColorAndroid="transparent" returnKeyType="done" // Muda o botão do teclado para "Concluído"
55
+ onSubmitEditing={dismissAll} // CORREÇÃO: Fecha o teclado no botão circulado
56
+ />
57
+ {search.length > 0 && (<TouchableOpacity onPress={handleClear} style={styles.clearIconWrapper}>
56
58
  <Icon name="close-line" size={14} color="#2A4FDA"/>
57
59
  </TouchableOpacity>)}
58
60
  </View>
59
- </View>
60
- <ScrollBar style={styles.scroll} barColor="#C9D5FF" barThickness={6}>
61
- <View style={{ paddingRight: 5 }}>
62
- {filteredOptions.length === 0 ? (<View style={styles.emptyContainer}>
63
- <SEText type="ns-sm-body-bold" style={styles.emptyTitle}>
64
- Nenhum resultado
65
- </SEText>
66
- <SEText type="ns-sm-body" style={styles.emptySubtitle}>
67
- Escreva palavras diferentes
68
- </SEText>
69
- </View>) : (filteredOptions.map((option, idx) => (<View key={option.value} style={{
70
- width: '100%',
71
- // Adiciona marginBottom apenas se não for o último item
72
- marginBottom: idx === filteredOptions.length - 1 ? 0 : 8,
73
- }}>
74
- <TouchableOpacity style={{
61
+
62
+ <ScrollBar style={styles.scroll} barColor="#C9D5FF" barThickness={6}>
63
+ {/* 4. View de conteúdo com paddingBottom para não colar no teclado */}
64
+ <View style={{ paddingRight: 5, paddingBottom: 20 }}>
65
+ {filteredOptions.length === 0 ? (<View style={styles.emptyContainer}>
66
+ <SEText type="ns-sm-body-bold" style={styles.emptyTitle}>Nenhum resultado</SEText>
67
+ <SEText type="ns-sm-body" style={styles.emptySubtitle}>Escreva palavras diferentes</SEText>
68
+ </View>) : (filteredOptions.map((option, idx) => (<TouchableOpacity key={option.value} style={{
75
69
  flexDirection: 'row',
76
70
  alignItems: 'center',
77
71
  width: '100%',
@@ -81,90 +75,68 @@ const FilterableMultiSelect = ({ options = [], placeholder = 'O que você procur
81
75
  borderColor: selected.includes(option.value) ? '#2A4FDA' : '#E2E9FC',
82
76
  backgroundColor: selected.includes(option.value) ? '#E3E9FF' : '#FFFFFF',
83
77
  paddingHorizontal: 16,
84
- }} disabled={option.disabled} onPress={() => onSelect(option.value)}>
85
- <CustomCheckbox selected={selected.includes(option.value)} iconColor={selected.includes(option.value) ? '#2A4FDA' : '#2A4FDA'} size={20}/>
78
+ marginBottom: 8,
79
+ }} onPress={() => {
80
+ // 5. Opcional: Se quiser que o teclado feche ao selecionar
81
+ // dismissAll();
82
+ onSelect(option.value);
83
+ }}>
84
+ <CustomCheckbox selected={selected.includes(option.value)} iconColor={'#2A4FDA'} size={20}/>
86
85
  <SEText type="ns-sm-body" style={{
87
86
  color: selected.includes(option.value) ? '#2A4FDA' : '#485274',
88
87
  marginLeft: 12,
89
88
  }}>
90
89
  {option.label}
91
90
  </SEText>
92
- </TouchableOpacity>
93
- </View>)))}
94
- </View>
95
- </ScrollBar>
96
- </View>);
91
+ </TouchableOpacity>)))}
92
+ </View>
93
+ </ScrollBar>
94
+ </View>
95
+ </TouchableWithoutFeedback>);
97
96
  };
98
97
  const styles = StyleSheet.create({
99
98
  container: {
99
+ flex: 1,
100
100
  width: '100%',
101
- alignSelf: 'center',
102
101
  backgroundColor: '#fff',
103
- borderRadius: 8,
104
- padding: 0,
105
- flex: 1,
106
102
  },
107
103
  inputWrapper: {
108
- position: 'relative',
109
104
  flexDirection: 'row',
110
105
  alignItems: 'center',
111
106
  borderRadius: 8,
112
- borderWidth: 1.5,
113
- borderColor: '#C9D5FF',
107
+ borderWidth: 2,
108
+ borderColor: '#96ACFF',
114
109
  marginBottom: 24,
115
110
  height: 49,
116
111
  backgroundColor: '#FFFFFF',
117
112
  },
118
113
  inputWrapperActive: {
114
+ borderWidth: 2,
119
115
  borderColor: '#2A4FDA',
116
+ outlineColor: '#96ACFF',
117
+ outlineWidth: 3,
120
118
  },
121
- searchIconWrapper: {
122
- paddingLeft: 16,
123
- paddingBottom: 2,
124
- },
125
- clearIconWrapper: {
126
- position: 'absolute',
127
- right: 16,
128
- top: 17,
119
+ inputOnpressIn: {
120
+ borderWidth: 2,
121
+ borderColor: '#2A4FDA',
129
122
  },
123
+ searchIconWrapper: { paddingLeft: 16 },
124
+ clearIconWrapper: { position: 'absolute', right: 16 },
130
125
  input: {
131
126
  flex: 1,
132
127
  height: '100%',
133
128
  paddingHorizontal: 12,
134
- paddingRight: 40,
129
+ fontSize: 16,
130
+ color: '#687499',
135
131
  ...Platform.select({
136
132
  ios: { fontFamily: 'Nunito Sans 10pt Regular' },
137
133
  android: { fontFamily: 'NunitoSans_10pt-Regular' },
138
134
  }),
139
- fontSize: 16,
140
- lineHeight: 24,
141
- letterSpacing: 0,
142
- color: '#687499',
143
- backgroundColor: 'transparent',
144
- },
145
- inputActive: {
146
- color: '#1B244B',
147
- },
148
- scroll: {
149
- zIndex: 1,
150
- paddingTop: 0,
151
- flex: 1,
152
- minHeight: 0,
153
- paddingRight: 5,
154
- },
155
- emptyContainer: {
156
- alignItems: 'center',
157
- justifyContent: 'center',
158
- paddingVertical: 12,
159
- },
160
- emptyTitle: {
161
- color: '#1B244B',
162
- fontSize: 16,
163
- marginBottom: 4,
164
- },
165
- emptySubtitle: {
166
- color: '#687499',
167
- fontSize: 14,
168
135
  },
136
+ inputActive: { color: '#1B244B' },
137
+ scroll: { flex: 1 },
138
+ emptyContainer: { alignItems: 'center', marginTop: 20 },
139
+ emptyTitle: { color: '#1B244B', fontSize: 16 },
140
+ emptySubtitle: { color: '#687499', fontSize: 14 },
169
141
  });
170
142
  export default FilterableMultiSelect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpt-sebraeds",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
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",