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.
Files changed (30) hide show
  1. package/lib/commonjs/components/card-maintenance/index.js +23 -16
  2. package/lib/commonjs/components/card-maintenance/index.js.map +1 -1
  3. package/lib/commonjs/components/card-maintenance/interface.d.js +4 -0
  4. package/lib/commonjs/components/modal-maintenance/index.js +28 -6
  5. package/lib/commonjs/components/modal-maintenance/index.js.map +1 -1
  6. package/lib/commonjs/utils/get-status-color/index.js +35 -0
  7. package/lib/commonjs/utils/get-status-color/index.js.map +1 -0
  8. package/lib/module/components/card-maintenance/index.js +24 -17
  9. package/lib/module/components/card-maintenance/index.js.map +1 -1
  10. package/lib/module/components/card-maintenance/interface.d.js +2 -0
  11. package/lib/module/components/modal-maintenance/index.js +28 -6
  12. package/lib/module/components/modal-maintenance/index.js.map +1 -1
  13. package/lib/module/utils/get-status-color/index.js +32 -0
  14. package/lib/module/utils/get-status-color/index.js.map +1 -0
  15. package/lib/typescript/commonjs/src/components/card-maintenance/index.d.ts +1 -1
  16. package/lib/typescript/commonjs/src/components/card-maintenance/index.d.ts.map +1 -1
  17. package/lib/typescript/commonjs/src/components/modal-maintenance/index.d.ts.map +1 -1
  18. package/lib/typescript/commonjs/src/utils/get-status-color/index.d.ts +14 -0
  19. package/lib/typescript/commonjs/src/utils/get-status-color/index.d.ts.map +1 -0
  20. package/lib/typescript/module/src/components/card-maintenance/index.d.ts +1 -1
  21. package/lib/typescript/module/src/components/card-maintenance/index.d.ts.map +1 -1
  22. package/lib/typescript/module/src/components/modal-maintenance/index.d.ts.map +1 -1
  23. package/lib/typescript/module/src/utils/get-status-color/index.d.ts +14 -0
  24. package/lib/typescript/module/src/utils/get-status-color/index.d.ts.map +1 -0
  25. package/package.json +1 -1
  26. package/src/components/card-maintenance/index.tsx +145 -146
  27. package/src/components/card-maintenance/interface.d.ts +33 -8
  28. package/src/components/modal-maintenance/index.tsx +184 -160
  29. package/src/components/modal-maintenance/interface.d.ts +17 -16
  30. 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
- const ModalMaintenance: React.FC<IModalMaintenanceProps> = ({
21
- visible,
22
- onClose,
23
- dataRegistro,
24
- descricao,
25
- imagemUrl,
26
- }) => {
27
- return (
28
- <Modal animationType="fade" transparent visible={visible}>
29
- <View
30
- style={{
31
- flex: 1,
32
- justifyContent: "center",
33
- alignItems: "center",
34
- backgroundColor: "rgba(0,0,0,0.6)",
35
- }}
36
- >
37
- <Box
38
- width={"90%"}
39
- backgroundColor={theme.colors.orange[500]}
40
- borderStyled={{
41
- borderRadius: theme.borderWidths.thick_medium,
42
- }}
43
- paddingStyle={{
44
- paddingLeft: theme.paddings["2xs"],
45
- paddingRight: theme.paddings["2xs"],
46
- paddingTop: theme.paddings.sm,
47
- paddingBottom: theme.paddings.sm,
48
- }}
49
- >
50
- <Box
51
- marginStyle={{ marginBottom: 10, marginLeft: 4 }}
52
- flexStyle={{ flexDirection: "row", alignItems: "center" }}
53
- >
54
- <Icons
55
- icon="EXCLAMATION_TRIANGLE"
56
- color={theme.colors.orange[500]}
57
- background={theme.colors.neutral[25]}
58
- size={theme.fontSizes.xl}
59
- />
60
- <Typography
61
- text="Manutenção"
62
- color="#fff"
63
- marginLeft={theme.margins["2xs"]}
64
- fontFamily={theme.fonts.inter_bold}
65
- size={theme.fontSizes.md}
66
- />
67
- </Box>
68
-
69
- <Box
70
- backgroundColor={theme.colors.gray[300]}
71
- paddingStyle={{
72
- padding: theme.paddings["2xs"],
73
- }}
74
- borderStyled={{
75
- borderRadius: theme.borderWidths.thick_medium,
76
- }}
77
- >
78
- <Box
79
- borderStyled={{
80
- borderWidth: 2,
81
- borderColor: theme.colors.black[10],
82
- borderRadius: theme.borderWidths.thick_medium,
83
- }}
84
- >
85
- <Image
86
- source={{ uri: imagemUrl ?? "https://placehold.co/300x300" }}
87
- resizeMode="cover"
88
- style={{
89
- width: "100%",
90
- height: 139,
91
- borderRadius: theme.borderWidths.thick_medium,
92
- }}
93
- />
94
- </Box>
95
- <Box flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}>
96
- <Typography
97
- text={`Data: `}
98
- marginTop={theme.margins.xs}
99
- color={theme.colors.black[25]}
100
- fontFamily={theme.fonts.inter_medium_500}
101
- size={theme.fontSizes.xs}
102
- />
103
- <Typography
104
- text={`${dataRegistro}`}
105
- marginTop={theme.margins.xs}
106
- color={theme.colors.gray[700]}
107
- fontFamily={theme.fonts.inter_regular_400}
108
- size={theme.fontSizes.xs}
109
- />
110
- </Box>
111
-
112
- <Typography
113
- text="Descrição:"
114
- color={theme.colors.black[25]}
115
- fontFamily={theme.fonts.inter_medium_500}
116
- size={theme.fontSizes.xs}
117
- />
118
-
119
- <Typography
120
- text={descricao}
121
- color={theme.colors.gray[700]}
122
- fontFamily={theme.fonts.inter_regular_400}
123
- size={theme.fontSizes.sm}
124
- lineHeight={theme.lineHeight.lg}
125
- />
126
- <Box
127
- flexStyle={{
128
- flexDirection: "row",
129
- justifyContent: "flex-end",
130
- }}
131
- >
132
- <TouchableOpacity
133
- onPress={onClose}
134
- style={{
135
- width: 127,
136
- height: 32,
137
- borderWidth: theme.borderWidths.thin,
138
- borderRadius: theme.borderWidths.thin_bold,
139
- borderColor: theme.colors.black[10],
140
- alignItems: "center",
141
- justifyContent: "center",
142
- marginTop: theme.margins.sm,
143
- }}
144
- >
145
- <Typography
146
- text="FECHAR"
147
- color={theme.colors.black[25]}
148
- fontFamily={theme.fonts.inter_medium_500}
149
- size={theme.fontSizes.xs}
150
- />
151
- </TouchableOpacity>
152
- </Box>
153
- </Box>
154
- </Box>
155
- </View>
156
- </Modal>
157
- );
158
- };
159
-
160
- export default ModalMaintenance;
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
- * EXPORTS
15
- */
16
- export { IModalMaintenanceProps };
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 };