jornada-ui 0.4.8 → 0.4.9
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/lib/commonjs/components/card-maintenance/index.js +23 -16
- package/lib/commonjs/components/card-maintenance/index.js.map +1 -1
- package/lib/commonjs/components/card-maintenance/interface.d.js +4 -0
- package/lib/commonjs/components/modal-maintenance/index.js +28 -6
- package/lib/commonjs/components/modal-maintenance/index.js.map +1 -1
- package/lib/commonjs/utils/get-status-color/index.js +35 -0
- package/lib/commonjs/utils/get-status-color/index.js.map +1 -0
- package/lib/module/components/card-maintenance/index.js +24 -17
- package/lib/module/components/card-maintenance/index.js.map +1 -1
- package/lib/module/components/card-maintenance/interface.d.js +2 -0
- package/lib/module/components/modal-maintenance/index.js +28 -6
- package/lib/module/components/modal-maintenance/index.js.map +1 -1
- package/lib/module/utils/get-status-color/index.js +32 -0
- package/lib/module/utils/get-status-color/index.js.map +1 -0
- package/lib/typescript/commonjs/src/components/card-maintenance/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/card-maintenance/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/modal-maintenance/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/get-status-color/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/utils/get-status-color/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/card-maintenance/index.d.ts +1 -1
- package/lib/typescript/module/src/components/card-maintenance/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/modal-maintenance/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/get-status-color/index.d.ts +14 -0
- package/lib/typescript/module/src/utils/get-status-color/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/card-maintenance/index.tsx +145 -146
- package/src/components/card-maintenance/interface.d.ts +33 -8
- package/src/components/modal-maintenance/index.tsx +184 -160
- package/src/components/modal-maintenance/interface.d.ts +17 -16
- package/src/utils/get-status-color/index.ts +31 -0
|
@@ -1,160 +1,184 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Modal, View, Image, TouchableOpacity } from "react-native";
|
|
6
|
-
|
|
7
|
-
// components
|
|
8
|
-
import Box from "../../components/box";
|
|
9
|
-
import Typography from "../../components/typography";
|
|
10
|
-
|
|
11
|
-
// commons / svg
|
|
12
|
-
import { Icons } from "../../common/icons-svg";
|
|
13
|
-
|
|
14
|
-
// typings
|
|
15
|
-
import type { IModalMaintenanceProps } from "./interface";
|
|
16
|
-
|
|
17
|
-
// styles
|
|
18
|
-
import { theme } from "../../styles/theme/theme";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Modal, View, Image, TouchableOpacity } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import Box from "../../components/box";
|
|
9
|
+
import Typography from "../../components/typography";
|
|
10
|
+
|
|
11
|
+
// commons / svg
|
|
12
|
+
import { Icons } from "../../common/icons-svg";
|
|
13
|
+
|
|
14
|
+
// typings
|
|
15
|
+
import type { IModalMaintenanceProps } from "./interface";
|
|
16
|
+
|
|
17
|
+
// styles
|
|
18
|
+
import { theme } from "../../styles/theme/theme";
|
|
19
|
+
import { getStatusColorHex } from "../../utils/get-status-color";
|
|
20
|
+
|
|
21
|
+
const ModalMaintenance: React.FC<IModalMaintenanceProps> = ({
|
|
22
|
+
visible,
|
|
23
|
+
onClose,
|
|
24
|
+
dataRegistro,
|
|
25
|
+
descricao,
|
|
26
|
+
status,
|
|
27
|
+
imagemUrl,
|
|
28
|
+
}) => {
|
|
29
|
+
return (
|
|
30
|
+
<Modal animationType="fade" transparent visible={visible}>
|
|
31
|
+
<View
|
|
32
|
+
style={{
|
|
33
|
+
flex: 1,
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
backgroundColor: "rgba(0,0,0,0.6)",
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<Box
|
|
40
|
+
width={"90%"}
|
|
41
|
+
backgroundColor={theme.colors.orange[500]}
|
|
42
|
+
borderStyled={{
|
|
43
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
44
|
+
}}
|
|
45
|
+
paddingStyle={{
|
|
46
|
+
paddingLeft: theme.paddings["2xs"],
|
|
47
|
+
paddingRight: theme.paddings["2xs"],
|
|
48
|
+
paddingTop: theme.paddings.sm,
|
|
49
|
+
paddingBottom: theme.paddings.sm,
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<Box
|
|
53
|
+
marginStyle={{ marginBottom: 10, marginLeft: 4 }}
|
|
54
|
+
flexStyle={{ flexDirection: "row", alignItems: "center" }}
|
|
55
|
+
>
|
|
56
|
+
<Icons
|
|
57
|
+
icon="EXCLAMATION_TRIANGLE"
|
|
58
|
+
color={theme.colors.orange[500]}
|
|
59
|
+
background={theme.colors.neutral[25]}
|
|
60
|
+
size={theme.fontSizes.xl}
|
|
61
|
+
/>
|
|
62
|
+
<Typography
|
|
63
|
+
text="Manutenção"
|
|
64
|
+
color="#fff"
|
|
65
|
+
marginLeft={theme.margins["2xs"]}
|
|
66
|
+
fontFamily={theme.fonts.inter_bold}
|
|
67
|
+
size={theme.fontSizes.md}
|
|
68
|
+
/>
|
|
69
|
+
</Box>
|
|
70
|
+
|
|
71
|
+
<Box
|
|
72
|
+
backgroundColor={theme.colors.gray[300]}
|
|
73
|
+
paddingStyle={{
|
|
74
|
+
padding: theme.paddings["2xs"],
|
|
75
|
+
}}
|
|
76
|
+
borderStyled={{
|
|
77
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<Box
|
|
81
|
+
borderStyled={{
|
|
82
|
+
borderWidth: 2,
|
|
83
|
+
borderColor: theme.colors.black[10],
|
|
84
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
<Image
|
|
88
|
+
source={{ uri: imagemUrl ?? "https://placehold.co/300x300" }}
|
|
89
|
+
resizeMode="cover"
|
|
90
|
+
style={{
|
|
91
|
+
width: "100%",
|
|
92
|
+
height: 139,
|
|
93
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
</Box>
|
|
97
|
+
<Box
|
|
98
|
+
marginStyle={{ marginTop: 8 }}
|
|
99
|
+
flexStyle={{
|
|
100
|
+
flexDirection: "row",
|
|
101
|
+
justifyContent: "flex-start",
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
<Typography
|
|
106
|
+
text={`Status: `}
|
|
107
|
+
color={theme.colors.black[25]}
|
|
108
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
109
|
+
size={theme.fontSizes.sm}
|
|
110
|
+
/>
|
|
111
|
+
<Box
|
|
112
|
+
width={10}
|
|
113
|
+
height={10}
|
|
114
|
+
borderStyled={{
|
|
115
|
+
borderRadius: 8,
|
|
116
|
+
}}
|
|
117
|
+
backgroundColor={getStatusColorHex(status)}
|
|
118
|
+
/>
|
|
119
|
+
</Box>
|
|
120
|
+
|
|
121
|
+
<Box flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}>
|
|
122
|
+
<Typography
|
|
123
|
+
text={`Data: `}
|
|
124
|
+
color={theme.colors.black[25]}
|
|
125
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
126
|
+
size={theme.fontSizes.sm}
|
|
127
|
+
/>
|
|
128
|
+
<Typography
|
|
129
|
+
text={`${dataRegistro}`}
|
|
130
|
+
color={theme.colors.gray[700]}
|
|
131
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
132
|
+
size={theme.fontSizes.xs}
|
|
133
|
+
/>
|
|
134
|
+
</Box>
|
|
135
|
+
|
|
136
|
+
<Typography
|
|
137
|
+
text="Descrição:"
|
|
138
|
+
color={theme.colors.black[25]}
|
|
139
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
140
|
+
size={theme.fontSizes.sm}
|
|
141
|
+
/>
|
|
142
|
+
|
|
143
|
+
<Typography
|
|
144
|
+
text={descricao}
|
|
145
|
+
color={theme.colors.gray[700]}
|
|
146
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
147
|
+
size={theme.fontSizes.sm}
|
|
148
|
+
lineHeight={theme.lineHeight.lg}
|
|
149
|
+
/>
|
|
150
|
+
<Box
|
|
151
|
+
flexStyle={{
|
|
152
|
+
flexDirection: "row",
|
|
153
|
+
justifyContent: "flex-end",
|
|
154
|
+
}}
|
|
155
|
+
>
|
|
156
|
+
<TouchableOpacity
|
|
157
|
+
onPress={onClose}
|
|
158
|
+
style={{
|
|
159
|
+
width: 127,
|
|
160
|
+
height: 32,
|
|
161
|
+
borderWidth: theme.borderWidths.thin,
|
|
162
|
+
borderRadius: theme.borderWidths.thin_bold,
|
|
163
|
+
borderColor: theme.colors.black[10],
|
|
164
|
+
alignItems: "center",
|
|
165
|
+
justifyContent: "center",
|
|
166
|
+
marginTop: theme.margins.sm,
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
<Typography
|
|
170
|
+
text="FECHAR"
|
|
171
|
+
color={theme.colors.black[25]}
|
|
172
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
173
|
+
size={theme.fontSizes.xs}
|
|
174
|
+
/>
|
|
175
|
+
</TouchableOpacity>
|
|
176
|
+
</Box>
|
|
177
|
+
</Box>
|
|
178
|
+
</Box>
|
|
179
|
+
</View>
|
|
180
|
+
</Modal>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export default ModalMaintenance;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
interface IModalMaintenanceProps {
|
|
5
|
-
visible: boolean;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
dataRegistro: string;
|
|
8
|
-
descricao: string;
|
|
9
|
-
imagemUrl?: string;
|
|
10
|
-
numero: number;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
interface IModalMaintenanceProps {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
dataRegistro: string;
|
|
8
|
+
descricao: string;
|
|
9
|
+
imagemUrl?: string;
|
|
10
|
+
numero: number;
|
|
11
|
+
status: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* EXPORTS
|
|
16
|
+
*/
|
|
17
|
+
export { IModalMaintenanceProps };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { theme } from "../../styles/theme/theme";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Function that will map property types to corresponding icons in SVG 🛠️.
|
|
9
|
+
* @param propertyType
|
|
10
|
+
* @returns SVG
|
|
11
|
+
*/
|
|
12
|
+
const getStatusColorHex = (propertyType: string) => {
|
|
13
|
+
switch (propertyType) {
|
|
14
|
+
case "Pendente":
|
|
15
|
+
return theme.colors.yellow[100];
|
|
16
|
+
|
|
17
|
+
case "Em Andamento":
|
|
18
|
+
return theme.colors.blue[150];
|
|
19
|
+
|
|
20
|
+
case "Concluido":
|
|
21
|
+
return theme.colors.green[400];
|
|
22
|
+
|
|
23
|
+
default:
|
|
24
|
+
return theme.colors.yellow[100]; // Retorna uma Svg default caso o tipo de propriedade não for reconhecido.
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* EXPORTS
|
|
30
|
+
*/
|
|
31
|
+
export { getStatusColorHex };
|