code7-leia 0.1.147 → 0.1.149

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.
@@ -8,5 +8,5 @@ interface SelectProps {
8
8
  onSelect: (value: string) => void;
9
9
  placeholder?: string;
10
10
  }
11
- declare const Select: React.FC<SelectProps>;
12
- export default Select;
11
+ declare const CustomSelect: React.FC<SelectProps>;
12
+ export default CustomSelect;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.147",
2
+ "version": "0.1.149",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -9,7 +9,7 @@ export const Input = styled.input`
9
9
  padding-left: 40px;
10
10
  border-radius: 5px;
11
11
  border: 1px solid #ccc;
12
- height: 40px;
12
+ height: 45px;
13
13
  width: 100%;
14
14
 
15
15
  &:focus {
@@ -20,7 +20,7 @@ export const Input = styled.input`
20
20
 
21
21
  export const IconContainer = styled.div`
22
22
  position: absolute;
23
- top: 10px;
23
+ top: 14px;
24
24
  left: 10px;
25
25
  pointer-events: none;
26
26
  `;
@@ -2,7 +2,7 @@ import styled from 'styled-components';
2
2
 
3
3
  export const MultiSelectWrapper = styled.div`
4
4
  width: 100%;
5
- height: 40px;
5
+ height: 45px;
6
6
  `;
7
7
 
8
8
  export const SelectBox = styled.div`
@@ -11,7 +11,7 @@ export const SelectBox = styled.div`
11
11
  select {
12
12
  width: 100%;
13
13
  font-weight: bold;
14
- height: 40px;
14
+ height: 45px;
15
15
  border-radius: 4px;
16
16
  }
17
17
  `;
@@ -44,7 +44,7 @@ export const Checkboxes = styled.div`
44
44
  z-index: 10;
45
45
 
46
46
  label {
47
- padding: 10px 0;
47
+ padding: 10px 5px;
48
48
  }
49
49
  `;
50
50
 
@@ -12,29 +12,37 @@ interface SelectProps {
12
12
  placeholder?: string;
13
13
  }
14
14
 
15
- const Select: React.FC<SelectProps> = ({ options, onSelect, placeholder }) => {
15
+ const CustomSelect: React.FC<SelectProps> = ({ options, onSelect, placeholder }) => {
16
+ const [isOpen, setIsOpen] = useState(false);
16
17
  const [selectedValue, setSelectedValue] = useState<string | number>('');
17
18
 
18
- const handleSelectChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
19
- const selectedOption = event.target.value;
20
- setSelectedValue(selectedOption);
21
- onSelect(selectedOption);
19
+ const handleSelectOption = (value: string | number) => {
20
+ const selected = String(value); // Convertendo para string
21
+ setSelectedValue(selected);
22
+ onSelect(selected);
23
+ setIsOpen(false);
22
24
  };
23
25
 
24
26
  return (
25
27
  <S.Container>
26
- <select value={selectedValue} onChange={handleSelectChange}>
27
- <option value="" disabled hidden>
28
- {placeholder}
29
- </option>
30
- {options.map(option => (
31
- <option key={option.value} value={option.value}>
32
- {option.label}
33
- </option>
34
- ))}
35
- </select>
28
+ <div className="custom-select" onClick={() => setIsOpen(!isOpen)}>
29
+ <div className="selected-option">{selectedValue || placeholder}</div>
30
+ {isOpen && (
31
+ <div className="options">
32
+ {options.map(option => (
33
+ <div
34
+ key={option.value}
35
+ className="option"
36
+ onClick={() => handleSelectOption(option.value)}
37
+ >
38
+ {option.label}
39
+ </div>
40
+ ))}
41
+ </div>
42
+ )}
43
+ </div>
36
44
  </S.Container>
37
45
  );
38
46
  };
39
47
 
40
- export default Select;
48
+ export default CustomSelect;
@@ -4,28 +4,41 @@ export const Container = styled.div`
4
4
  position: relative;
5
5
  width: 50%;
6
6
  margin-right: 5px;
7
- select {
8
- padding: 12px;
9
- border-radius: 4px;
10
- border: 1px solid #979AA5;
7
+
8
+ .custom-select {
9
+ position: relative;
11
10
  width: 100%;
12
- height: 40px;
13
-
14
- &:focus {
15
- outline: none;
16
- box-shadow: 0 0 0 3px #6690ff;
17
- }
11
+ cursor: pointer;
18
12
 
19
- option {
20
- background: white;
21
- font-size: 14px;
22
- color: #5a5d68;
13
+ .selected-option {
14
+ padding: 12px;
15
+ border-radius: 4px;
16
+ border: 1px solid #979AA5;
17
+ height: 45px;
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: space-between;
23
21
  }
24
22
 
25
- option:checked, option:hover {
26
- background: #6690ff;
27
- font-size: 14px;
28
- color: white;
23
+ .options {
24
+ position: absolute;
25
+ top: 100%;
26
+ left: 0;
27
+ width: 100%;
28
+ border: 1px solid #979AA5;
29
+ border-top: none;
30
+ border-radius: 0 0 4px 4px;
31
+ background-color: #fff;
32
+
33
+ .option {
34
+ padding: 12px;
35
+ cursor: pointer;
36
+ transition: background-color 0.3s;
37
+
38
+ &:hover {
39
+ background-color: #f0f0f0;
40
+ }
41
+ }
29
42
  }
30
43
  }
31
44
  `;
@@ -12,7 +12,7 @@ export const StyledInput = styled.input`
12
12
  padding-right: 40px;
13
13
  border-radius: 5px;
14
14
  border: 1px solid #ccc;
15
- height: 40px;
15
+ height: 45px;
16
16
  width: 100%;
17
17
 
18
18
  &:focus {
@@ -23,7 +23,7 @@ export const StyledInput = styled.input`
23
23
 
24
24
  export const RecordAudioButton = styled.div`
25
25
  position: absolute;
26
- top: 10px;
26
+ top: 14px;
27
27
  right: 10px;
28
28
  cursor: pointer;
29
29
  `;
@@ -69,7 +69,7 @@ export const Inputs = styled.div`
69
69
  color: white;
70
70
  border-radius: 4px;
71
71
  width: 190px;
72
- height: 40px;
72
+ height: 45px;
73
73
  display: flex;
74
74
  justify-content: space-between;
75
75
  align-items: center;