code7-leia 0.2.361 → 1.0.1
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.
- package/README.md +107 -1
- package/dist/code7-leia.css +1 -0
- package/dist/index.cjs.js +1053 -0
- package/dist/index.es.js +10512 -0
- package/package.json +35 -71
- package/dist/Leia.d.ts +0 -3
- package/dist/code7-leia.cjs.development.js +0 -2466
- package/dist/code7-leia.cjs.development.js.map +0 -1
- package/dist/code7-leia.cjs.production.min.js +0 -2
- package/dist/code7-leia.cjs.production.min.js.map +0 -1
- package/dist/code7-leia.esm.js +0 -2458
- package/dist/code7-leia.esm.js.map +0 -1
- package/dist/components/CustomToast/index.d.ts +0 -13
- package/dist/components/CustomToast/styles.d.ts +0 -6
- package/dist/components/EmptyState/index.d.ts +0 -16
- package/dist/components/EmptyState/styles.d.ts +0 -7
- package/dist/components/FileArea/components/AreaUpload/index.d.ts +0 -24
- package/dist/components/FileArea/components/AreaUpload/styles.d.ts +0 -8
- package/dist/components/FileArea/components/Modal/ModalButtonClose.d.ts +0 -6
- package/dist/components/FileArea/components/Modal/ModalContent.d.ts +0 -8
- package/dist/components/FileArea/components/Modal/ModalFooter.d.ts +0 -6
- package/dist/components/FileArea/components/Modal/ModalHeader.d.ts +0 -6
- package/dist/components/FileArea/components/Modal/ModalTitle.d.ts +0 -6
- package/dist/components/FileArea/components/Modal/index.d.ts +0 -22
- package/dist/components/FileArea/components/Modal/styles.d.ts +0 -25
- package/dist/components/FileArea/components/Search/index.d.ts +0 -9
- package/dist/components/FileArea/components/Search/styles.d.ts +0 -3
- package/dist/components/FileArea/components/Spinner/index.d.ts +0 -4
- package/dist/components/FileArea/components/Spinner/styles.d.ts +0 -1
- package/dist/components/FileArea/components/Table/index.d.ts +0 -4
- package/dist/components/FileArea/components/Table/styles.d.ts +0 -3
- package/dist/components/FileArea/index.d.ts +0 -2
- package/dist/components/FileArea/styles.d.ts +0 -6
- package/dist/components/MultiSelect/index.d.ts +0 -17
- package/dist/components/MultiSelect/styles.d.ts +0 -7
- package/dist/components/Select/index.d.ts +0 -12
- package/dist/components/Select/styles.d.ts +0 -1
- package/dist/components/Tabs/index.d.ts +0 -35
- package/dist/components/Tabs/styles.d.ts +0 -13
- package/dist/components/TestArea/components/InputTest/index.d.ts +0 -7
- package/dist/components/TestArea/components/InputTest/styles.d.ts +0 -3
- package/dist/components/TestArea/components/TextArea/index.d.ts +0 -19
- package/dist/components/TestArea/components/TextArea/styles.d.ts +0 -10
- package/dist/components/TestArea/index.d.ts +0 -2
- package/dist/components/TestArea/styles.d.ts +0 -8
- package/dist/contexts/SharedPropsProvider.d.ts +0 -19
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -8
- package/dist/interface/FileData.d.ts +0 -10
- package/dist/interface/Language.d.ts +0 -90
- package/dist/interface/Table.d.ts +0 -12
- package/dist/service/Api.d.ts +0 -3
- package/dist/service/ApiDev.d.ts +0 -3
- package/dist/service/ApiHml.d.ts +0 -3
- package/dist/store/index.d.ts +0 -10
- package/dist/store/modules/actions.d.ts +0 -93
- package/dist/store/modules/reducer.d.ts +0 -13
- package/dist/store/modules/sagas.d.ts +0 -26
- package/dist/store/modules/types.d.ts +0 -18
- package/dist/utils/formatAxios.d.ts +0 -3
- package/dist/utils/getApi.d.ts +0 -1
- package/dist/utils/getLanguage.d.ts +0 -2
- package/dist/utils/languages/en.d.ts +0 -2
- package/dist/utils/languages/es.d.ts +0 -2
- package/dist/utils/languages/pt-br.d.ts +0 -2
- package/src/Leia.tsx +0 -44
- package/src/components/CustomToast/index.tsx +0 -62
- package/src/components/CustomToast/styles.tsx +0 -73
- package/src/components/EmptyState/index.tsx +0 -88
- package/src/components/EmptyState/styles.tsx +0 -81
- package/src/components/FileArea/components/AreaUpload/index.tsx +0 -137
- package/src/components/FileArea/components/AreaUpload/styles.tsx +0 -75
- package/src/components/FileArea/components/Modal/ModalButtonClose.tsx +0 -23
- package/src/components/FileArea/components/Modal/ModalContent.tsx +0 -26
- package/src/components/FileArea/components/Modal/ModalFooter.tsx +0 -18
- package/src/components/FileArea/components/Modal/ModalHeader.tsx +0 -18
- package/src/components/FileArea/components/Modal/ModalTitle.tsx +0 -18
- package/src/components/FileArea/components/Modal/index.tsx +0 -131
- package/src/components/FileArea/components/Modal/styles.tsx +0 -121
- package/src/components/FileArea/components/Search/index.tsx +0 -44
- package/src/components/FileArea/components/Search/styles.tsx +0 -26
- package/src/components/FileArea/components/Spinner/index.tsx +0 -22
- package/src/components/FileArea/components/Spinner/styles.tsx +0 -59
- package/src/components/FileArea/components/Table/index.tsx +0 -34
- package/src/components/FileArea/components/Table/styles.tsx +0 -60
- package/src/components/FileArea/index.tsx +0 -281
- package/src/components/FileArea/styles.tsx +0 -183
- package/src/components/MultiSelect/index.tsx +0 -102
- package/src/components/MultiSelect/styles.tsx +0 -77
- package/src/components/Select/index.tsx +0 -53
- package/src/components/Select/styles.tsx +0 -49
- package/src/components/Tabs/index.tsx +0 -71
- package/src/components/Tabs/styles.tsx +0 -87
- package/src/components/TestArea/components/InputTest/index.tsx +0 -21
- package/src/components/TestArea/components/InputTest/styles.tsx +0 -28
- package/src/components/TestArea/components/TextArea/index.tsx +0 -97
- package/src/components/TestArea/components/TextArea/styles.tsx +0 -171
- package/src/components/TestArea/index.tsx +0 -101
- package/src/components/TestArea/styles.tsx +0 -112
- package/src/contexts/SharedPropsProvider.tsx +0 -79
- package/src/index.tsx +0 -20
- package/src/interface/FileData.ts +0 -11
- package/src/interface/Language.ts +0 -93
- package/src/interface/Table.ts +0 -12
- package/src/service/Api.ts +0 -9
- package/src/service/ApiDev.ts +0 -9
- package/src/service/ApiHml.ts +0 -9
- package/src/store/index.ts +0 -13
- package/src/store/modules/actions.ts +0 -88
- package/src/store/modules/reducer.ts +0 -46
- package/src/store/modules/sagas.ts +0 -127
- package/src/store/modules/types.ts +0 -19
- package/src/types/image.d.ts +0 -4
- package/src/utils/formatAxios.tsx +0 -15
- package/src/utils/getApi.tsx +0 -16
- package/src/utils/getLanguage.tsx +0 -17
- package/src/utils/languages/en.ts +0 -87
- package/src/utils/languages/es.ts +0 -87
- package/src/utils/languages/pt-br.ts +0 -87
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
interface ContainerProps {
|
|
4
|
-
isloading?: boolean;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const Container = styled.div<ContainerProps>`
|
|
8
|
-
${(props) =>
|
|
9
|
-
props.isloading &&
|
|
10
|
-
css`
|
|
11
|
-
#loading {
|
|
12
|
-
position: fixed;
|
|
13
|
-
top: 0;
|
|
14
|
-
left: 0;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
background-color: rgb(151,154,165, 0.7);
|
|
18
|
-
display: flex;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
align-items: center;
|
|
21
|
-
z-index: 9999;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
#loading::after {
|
|
25
|
-
content: "";
|
|
26
|
-
border: 4px solid #f3f3f3; /* Cor do símbolo de carregamento */
|
|
27
|
-
border-top: 4px solid #5a5d68; /* Cor do símbolo de carregamento */
|
|
28
|
-
border-radius: 50%;
|
|
29
|
-
width: 13px;
|
|
30
|
-
height: 13px;
|
|
31
|
-
animation: spin 1s linear infinite;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@keyframes spin {
|
|
35
|
-
0% { transform: rotate(0deg); }
|
|
36
|
-
100% { transform: rotate(360deg); }
|
|
37
|
-
}
|
|
38
|
-
`}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.tag {
|
|
42
|
-
padding: 4px 8px 4px 8px;
|
|
43
|
-
background: #C7F9ED;
|
|
44
|
-
border-radius: 4px;
|
|
45
|
-
display: flex;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
align-items: center;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.tags {
|
|
51
|
-
display: flex;
|
|
52
|
-
justify-content: left;
|
|
53
|
-
gap: 4px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.divDelete {
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: flex-start;
|
|
60
|
-
gap: 4px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.buttonDelete {
|
|
64
|
-
color: #5b0a1f;
|
|
65
|
-
background: #fae0d2;
|
|
66
|
-
padding: 12px 20px;
|
|
67
|
-
border-radius: 4px;
|
|
68
|
-
|
|
69
|
-
&:disabled {
|
|
70
|
-
cursor: not-allowed;
|
|
71
|
-
opacity: 0.7;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.buttonDelete:hover {
|
|
76
|
-
background: #f5bba7;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.buttonTraining {
|
|
80
|
-
color: #023906;
|
|
81
|
-
background: #e3f8cc;
|
|
82
|
-
padding: 12px 20px;
|
|
83
|
-
border-radius: 4px;
|
|
84
|
-
margin-right: 10px;
|
|
85
|
-
|
|
86
|
-
&:disabled {
|
|
87
|
-
cursor: not-allowed;
|
|
88
|
-
opacity: 0.7;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.buttonTraining:hover {
|
|
93
|
-
background: #90d665;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.button {
|
|
97
|
-
padding: 8px 16px 8px 16px;
|
|
98
|
-
border-radius: 4px;
|
|
99
|
-
gap: 10px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.cancel {
|
|
103
|
-
background: #F3F5F9;
|
|
104
|
-
color: #5A5D68;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.send {
|
|
108
|
-
background: #102693;
|
|
109
|
-
color: white;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.delete {
|
|
113
|
-
background: #871821;
|
|
114
|
-
color: white;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.presset {
|
|
118
|
-
padding-top: 10px;
|
|
119
|
-
display: flex;
|
|
120
|
-
flex-direction: column;
|
|
121
|
-
|
|
122
|
-
p {
|
|
123
|
-
font-size: 14px;
|
|
124
|
-
font-weight: 600;
|
|
125
|
-
padding: 4px 0;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
#warning {
|
|
130
|
-
padding: 10px;
|
|
131
|
-
background: #FAE0D2;
|
|
132
|
-
color: #871821;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
#info {
|
|
136
|
-
padding: 10px;
|
|
137
|
-
background: #c7f9ed;
|
|
138
|
-
color: #00344e;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
`;
|
|
142
|
-
|
|
143
|
-
export const Header = styled.div`
|
|
144
|
-
display: flex;
|
|
145
|
-
flex-direction: column;
|
|
146
|
-
|
|
147
|
-
#button-upload {
|
|
148
|
-
margin-right: 10px;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.infos {
|
|
152
|
-
display: flex;
|
|
153
|
-
flex-direction: column;
|
|
154
|
-
padding: 14px 0;
|
|
155
|
-
|
|
156
|
-
h2 {
|
|
157
|
-
font-size: 20px
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
p {
|
|
161
|
-
font-size: 14px
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.actions {
|
|
166
|
-
display: flex;
|
|
167
|
-
justify-content: space-between;
|
|
168
|
-
padding-bottom: 14px;
|
|
169
|
-
|
|
170
|
-
button {
|
|
171
|
-
background: #102693;
|
|
172
|
-
padding: 10px 20px;
|
|
173
|
-
color: white;
|
|
174
|
-
border-radius: 4px;
|
|
175
|
-
|
|
176
|
-
&:disabled {
|
|
177
|
-
cursor: not-allowed;
|
|
178
|
-
opacity: 0.7;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
`
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import * as S from './styles';
|
|
3
|
-
import { getLanguage } from '../../utils/getLanguage'
|
|
4
|
-
import { Language } from '../../interface/Language';
|
|
5
|
-
|
|
6
|
-
interface Option {
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface MultiSelectProps {
|
|
12
|
-
options: Option[];
|
|
13
|
-
presset: string[];
|
|
14
|
-
setPresset: React.Dispatch<React.SetStateAction<string[]>>;
|
|
15
|
-
setOptions: React.Dispatch<React.SetStateAction<Option[]>>;
|
|
16
|
-
modal: boolean;
|
|
17
|
-
hasAddNewOptions: boolean;
|
|
18
|
-
language: keyof Record<'en' | 'pt-br' | 'es', Language>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const MultiSelect: React.FC<MultiSelectProps> = ({ options, presset, setPresset, setOptions, modal, language, hasAddNewOptions }) => {
|
|
22
|
-
const [expanded, setExpanded] = useState(false);
|
|
23
|
-
const [newOption, setNewOption] = useState('');
|
|
24
|
-
const t = getLanguage(language)
|
|
25
|
-
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
setExpanded(false)
|
|
28
|
-
}, [modal])
|
|
29
|
-
|
|
30
|
-
const handleCheckboxChange = (value: string) => {
|
|
31
|
-
setPresset(prevPresset => {
|
|
32
|
-
if (prevPresset.includes(value)) {
|
|
33
|
-
return prevPresset.filter(val => val !== value);
|
|
34
|
-
} else {
|
|
35
|
-
return [...prevPresset, value];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const showCheckboxes = () => {
|
|
41
|
-
setExpanded(!expanded);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
45
|
-
setNewOption(event.target.value);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const handleInputKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
49
|
-
if (event.key === 'Enter' && hasAddNewOptions) {
|
|
50
|
-
event.preventDefault();
|
|
51
|
-
const trimmedOption = newOption.trim();
|
|
52
|
-
if (trimmedOption !== '' && !options.some(option => option.value === trimmedOption)) {
|
|
53
|
-
setOptions(prevOptions => [...prevOptions, { label: trimmedOption, value: trimmedOption }]);
|
|
54
|
-
setPresset(prevPresset => [...prevPresset, trimmedOption]);
|
|
55
|
-
}
|
|
56
|
-
setNewOption('');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<form>
|
|
62
|
-
<S.MultiSelectWrapper>
|
|
63
|
-
<S.SelectBox onClick={showCheckboxes}>
|
|
64
|
-
<select>
|
|
65
|
-
{options.map((option, index) => (
|
|
66
|
-
<option key={index} value={option.value}>{option.label}</option>
|
|
67
|
-
))}
|
|
68
|
-
</select>
|
|
69
|
-
<S.OverSelect>
|
|
70
|
-
<S.SelectedValues>
|
|
71
|
-
{presset.map((value, index) => (
|
|
72
|
-
<S.SelectedValue key={index}>{value}</S.SelectedValue>
|
|
73
|
-
))}
|
|
74
|
-
</S.SelectedValues>
|
|
75
|
-
<input
|
|
76
|
-
type="text"
|
|
77
|
-
placeholder={hasAddNewOptions ? t.buttons.addNewPresset : t.buttons.addPresset}
|
|
78
|
-
value={newOption}
|
|
79
|
-
onChange={handleInputChange}
|
|
80
|
-
onKeyPress={handleInputKeyPress}
|
|
81
|
-
/>
|
|
82
|
-
</S.OverSelect>
|
|
83
|
-
</S.SelectBox>
|
|
84
|
-
<S.Checkboxes style={{ display: expanded ? 'block' : 'none' }}>
|
|
85
|
-
{options.map((option, index) => (
|
|
86
|
-
<S.CheckboxLabel key={index} htmlFor={option.value}>
|
|
87
|
-
<input
|
|
88
|
-
type="checkbox"
|
|
89
|
-
id={option.value}
|
|
90
|
-
checked={presset.includes(option.value)}
|
|
91
|
-
onChange={() => handleCheckboxChange(option.value)}
|
|
92
|
-
/>
|
|
93
|
-
{option.label}
|
|
94
|
-
</S.CheckboxLabel>
|
|
95
|
-
))}
|
|
96
|
-
</S.Checkboxes>
|
|
97
|
-
</S.MultiSelectWrapper>
|
|
98
|
-
</form>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export default MultiSelect;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const MultiSelectWrapper = styled.div`
|
|
4
|
-
width: 100%;
|
|
5
|
-
height: 45px;
|
|
6
|
-
`;
|
|
7
|
-
|
|
8
|
-
export const SelectBox = styled.div`
|
|
9
|
-
position: relative;
|
|
10
|
-
|
|
11
|
-
select {
|
|
12
|
-
width: 100%;
|
|
13
|
-
font-weight: bold;
|
|
14
|
-
height: 45px;
|
|
15
|
-
border-radius: 4px;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
export const OverSelect = styled.div`
|
|
20
|
-
position: absolute;
|
|
21
|
-
left: 0;
|
|
22
|
-
right: 0;
|
|
23
|
-
top: 0;
|
|
24
|
-
bottom: 0;
|
|
25
|
-
display: flex;
|
|
26
|
-
|
|
27
|
-
input {
|
|
28
|
-
height: 43px;
|
|
29
|
-
width: calc(100% - 30px);
|
|
30
|
-
border: none;
|
|
31
|
-
margin: 1px;
|
|
32
|
-
|
|
33
|
-
&:focus {
|
|
34
|
-
outline: none;
|
|
35
|
-
box-shadow: 0 0 0 3px #6690ff;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
export const Checkboxes = styled.div`
|
|
41
|
-
display: none;
|
|
42
|
-
background: white;
|
|
43
|
-
position: absolute;
|
|
44
|
-
width: 95%;
|
|
45
|
-
z-index: 10;
|
|
46
|
-
|
|
47
|
-
label {
|
|
48
|
-
padding: 10px 5px;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
|
|
52
|
-
export const CheckboxLabel = styled.label`
|
|
53
|
-
display: block;
|
|
54
|
-
|
|
55
|
-
&:hover {
|
|
56
|
-
background-color: #6690ff;
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
|
|
60
|
-
export const SelectedValues = styled.div`
|
|
61
|
-
position: absolute;
|
|
62
|
-
top: 9px;
|
|
63
|
-
display: flex;
|
|
64
|
-
flex-wrap: wrap;
|
|
65
|
-
margin-left: 5px;
|
|
66
|
-
right: 30px;
|
|
67
|
-
`;
|
|
68
|
-
|
|
69
|
-
export const SelectedValue = styled.div`
|
|
70
|
-
background-color: #254EDB;
|
|
71
|
-
color: white;
|
|
72
|
-
border-radius: 15px;
|
|
73
|
-
padding: 5px 10px;
|
|
74
|
-
margin-right: 5px;
|
|
75
|
-
margin-bottom: 5px;
|
|
76
|
-
white-space: nowrap;
|
|
77
|
-
`;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import * as S from './styles';
|
|
3
|
-
|
|
4
|
-
interface SelectOption {
|
|
5
|
-
value: string | number;
|
|
6
|
-
label: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface SelectProps {
|
|
10
|
-
options: SelectOption[];
|
|
11
|
-
onSelect: (value: string) => void;
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const CustomSelect: React.FC<SelectProps> = ({ options, onSelect, placeholder }) => {
|
|
16
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
17
|
-
const [selectedValue, setSelectedValue] = useState<string | number>('');
|
|
18
|
-
|
|
19
|
-
const handleSelectOption = (value: string | number) => {
|
|
20
|
-
const selected = String(value);
|
|
21
|
-
setSelectedValue(selected);
|
|
22
|
-
onSelect(selected);
|
|
23
|
-
setIsOpen(false);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<S.Container>
|
|
28
|
-
<div className="custom-select" onClick={() => setIsOpen(!isOpen)}>
|
|
29
|
-
<div className="selected-option">
|
|
30
|
-
{selectedValue || placeholder}
|
|
31
|
-
<span className="arrow">▼</span>
|
|
32
|
-
</div>
|
|
33
|
-
{isOpen && (
|
|
34
|
-
<div className="options">
|
|
35
|
-
{options.map(option => (
|
|
36
|
-
<div
|
|
37
|
-
key={option.value}
|
|
38
|
-
style={{ background: option.value === selectedValue ? '#a0b7f5' : undefined,
|
|
39
|
-
color: option.value === selectedValue ? 'white' : undefined }}
|
|
40
|
-
className="option"
|
|
41
|
-
onClick={() => handleSelectOption(option.value)}
|
|
42
|
-
>
|
|
43
|
-
{option.label}
|
|
44
|
-
</div>
|
|
45
|
-
))}
|
|
46
|
-
</div>
|
|
47
|
-
)}
|
|
48
|
-
</div>
|
|
49
|
-
</S.Container>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export default CustomSelect;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const Container = styled.div`
|
|
4
|
-
position: relative;
|
|
5
|
-
width: 50%;
|
|
6
|
-
margin-right: 5px;
|
|
7
|
-
|
|
8
|
-
.custom-select {
|
|
9
|
-
position: relative;
|
|
10
|
-
width: 100%;
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
|
|
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;
|
|
21
|
-
font-size: 14px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.options {
|
|
25
|
-
position: absolute;
|
|
26
|
-
top: 100%;
|
|
27
|
-
left: 0;
|
|
28
|
-
width: 100%;
|
|
29
|
-
border: 1px solid #979AA5;
|
|
30
|
-
border-top: none;
|
|
31
|
-
border-radius: 0 0 4px 4px;
|
|
32
|
-
background-color: #fff;
|
|
33
|
-
z-index: 9;
|
|
34
|
-
|
|
35
|
-
.option {
|
|
36
|
-
padding: 12px;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
transition: background-color 0.1s;
|
|
39
|
-
letter-spacing: 0.5px;
|
|
40
|
-
font-size: 14px;
|
|
41
|
-
|
|
42
|
-
&:hover {
|
|
43
|
-
background-color: #6690ff;
|
|
44
|
-
color: white;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cc from 'classcat';
|
|
4
|
-
|
|
5
|
-
import * as S from './styles';
|
|
6
|
-
|
|
7
|
-
interface TabProps {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
active?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface ITabsProps {
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
value: string | number;
|
|
15
|
-
onChange: (e: any) => void;
|
|
16
|
-
active?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const Tab = ({ active, children, ...rest }: TabProps) => {
|
|
20
|
-
return (
|
|
21
|
-
<S.Tab className={cc({ active })} {...rest}>
|
|
22
|
-
{children}
|
|
23
|
-
</S.Tab>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
Tab.propTypes = {
|
|
28
|
-
children: PropTypes.oneOfType([
|
|
29
|
-
PropTypes.string,
|
|
30
|
-
PropTypes.element,
|
|
31
|
-
PropTypes.node,
|
|
32
|
-
]).isRequired,
|
|
33
|
-
onChange: PropTypes.func,
|
|
34
|
-
value: PropTypes.string,
|
|
35
|
-
active: PropTypes.bool,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
Tab.defaultProps = {
|
|
39
|
-
onChange: () => {},
|
|
40
|
-
value: '',
|
|
41
|
-
active: false,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const Tabs = ({ children: childrenProp, value, onChange, ...rest }: ITabsProps) => {
|
|
45
|
-
const children = React.Children.map(childrenProp, (child) => {
|
|
46
|
-
if (!React.isValidElement(child)) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (Array.isArray(child.props?.children)) {
|
|
51
|
-
return React.cloneElement(child as React.ReactElement<any>, {
|
|
52
|
-
active: child.props?.value === value,
|
|
53
|
-
value,
|
|
54
|
-
onChange,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return React.cloneElement(child as React.ReactElement<any>, {
|
|
59
|
-
active: child.props?.value === value,
|
|
60
|
-
onClick: () => onChange(child.props?.value),
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
return <S.TabsPane {...rest}>{children}</S.TabsPane>;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
Tabs.propTypes = {
|
|
68
|
-
children: PropTypes.node.isRequired,
|
|
69
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
70
|
-
onChange: PropTypes.func.isRequired,
|
|
71
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
interface TabProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface OptionProps {
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
onClick: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const TabsPane = styled.ul`
|
|
14
|
-
width: max-content;
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
border-bottom: 1px solid var(--neutral-1);
|
|
18
|
-
`;
|
|
19
|
-
|
|
20
|
-
export const Tab = styled.li<TabProps>`
|
|
21
|
-
padding: 12px;
|
|
22
|
-
color: var(--neutral-3);
|
|
23
|
-
font-size: 0.875rem;
|
|
24
|
-
font-weight: normal;
|
|
25
|
-
position: relative;
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
|
|
28
|
-
svg {
|
|
29
|
-
fill: var(--neutral-3) !important;
|
|
30
|
-
margin-left: 8px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.active {
|
|
34
|
-
color: var(--primary-700-light);
|
|
35
|
-
|
|
36
|
-
svg {
|
|
37
|
-
fill: var(--primary-700-light) !important;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
::after {
|
|
41
|
-
content: '';
|
|
42
|
-
position: absolute;
|
|
43
|
-
bottom: 0;
|
|
44
|
-
left: 0;
|
|
45
|
-
width: 100%;
|
|
46
|
-
height: 2px;
|
|
47
|
-
background-color: var(--primary-700-light);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&:not(:last-child) {
|
|
52
|
-
margin-right: 8px;
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
|
|
56
|
-
export const DropdownContainer = styled.div`
|
|
57
|
-
position: absolute;
|
|
58
|
-
left: 0px;
|
|
59
|
-
top: 40px;
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
|
|
63
|
-
background: #ffffff;
|
|
64
|
-
|
|
65
|
-
border: 1px solid #979aa5;
|
|
66
|
-
box-sizing: border-box;
|
|
67
|
-
box-shadow: 0px 6px 12px -6px rgba(24, 39, 75, 0.12),
|
|
68
|
-
0px 8px 24px -4px rgba(24, 39, 75, 0.08);
|
|
69
|
-
border-radius: 4px;
|
|
70
|
-
padding: 8px;
|
|
71
|
-
z-index: 2;
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
export const Option = styled.div<OptionProps>`
|
|
75
|
-
padding: 8px;
|
|
76
|
-
font-size: 14px;
|
|
77
|
-
border-radius: 4px;
|
|
78
|
-
cursor: pointer;
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
text-overflow: ellipsis;
|
|
81
|
-
white-space: nowrap;
|
|
82
|
-
|
|
83
|
-
&:hover {
|
|
84
|
-
background-color: var(--primary-800-light);
|
|
85
|
-
color: white;
|
|
86
|
-
}
|
|
87
|
-
`;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as S from './styles';
|
|
3
|
-
|
|
4
|
-
interface InputTestProps {
|
|
5
|
-
placeholder: string;
|
|
6
|
-
onChange: (value: string) => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const InputTest: React.FC<InputTestProps> = ({ placeholder, onChange }) => {
|
|
10
|
-
return (
|
|
11
|
-
<S.Container>
|
|
12
|
-
<S.StyledInput
|
|
13
|
-
type="text"
|
|
14
|
-
onChange={(e: any) => onChange(e.target.value)}
|
|
15
|
-
placeholder={placeholder}
|
|
16
|
-
/>
|
|
17
|
-
</S.Container>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default InputTest;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const Container = styled.div`
|
|
4
|
-
position: relative;
|
|
5
|
-
width: 100%;
|
|
6
|
-
margin-right: 5px;
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
export const StyledInput = styled.input`
|
|
10
|
-
padding-left: 10px;
|
|
11
|
-
padding-right: 40px;
|
|
12
|
-
border-radius: 5px;
|
|
13
|
-
border: 1px solid #ccc;
|
|
14
|
-
height: 45px;
|
|
15
|
-
width: 100%;
|
|
16
|
-
|
|
17
|
-
&:focus {
|
|
18
|
-
outline: none;
|
|
19
|
-
box-shadow: 0 0 0 3px #6690ff;
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
export const RecordAudioButton = styled.div`
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: 14px;
|
|
26
|
-
right: 10px;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
`;
|