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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/card-maintenance/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAcxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;;AAgIpD,wBAAgD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/card-maintenance/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAcpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;;AA+HpD,wBAAgD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal-maintenance/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAK1D,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA0ItD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal-maintenance/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAM1D,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAiKtD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ /**
5
+ * Function that will map property types to corresponding icons in SVG 🛠️.
6
+ * @param propertyType
7
+ * @returns SVG
8
+ */
9
+ declare const getStatusColorHex: (propertyType: string) => string;
10
+ /**
11
+ * EXPORTS
12
+ */
13
+ export { getStatusColorHex };
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/get-status-color/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,QAAA,MAAM,iBAAiB,iBAAkB,MAAM,WAc9C,CAAC;AAEF;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jornada-ui",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Biblioteca para desenvolvimento dos componentes para utilizar nos app",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -1,146 +1,145 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React, { useState } from "react";
5
-
6
- import { Image, View, TouchableOpacity } from "react-native";
7
-
8
- import ModalMaintenance from "../modal-maintenance";
9
-
10
- // components
11
- import Box from "../../components/box";
12
- import Typography from "../../components/typography";
13
-
14
- // theme
15
- import { theme } from "../../styles/theme/theme";
16
-
17
- // typings
18
- import type { ICardMaintenance } from "./interface";
19
- import { asBaseComponent } from "../../@types/as-base-component";
20
-
21
- /**
22
- * COMPONENT
23
- */
24
- const CardMaintenance: React.FC<ICardMaintenance> = ({
25
- numero,
26
- dataRegistro,
27
- cavalo,
28
- imagemUrl,
29
- descricao,
30
- }) => {
31
- const [showModal, setShowModal] = useState(false);
32
- return (
33
- <>
34
- <TouchableOpacity onPress={() => setShowModal(true)} activeOpacity={0.9}>
35
- <Box
36
- width={"100%"}
37
- flexStyle={{ flexDirection: "row" }}
38
- backgroundColor={theme.colors.neutral[25]}
39
- borderStyled={{
40
- borderRadius: theme.borderWidths.thick_medium,
41
- }}
42
- marginStyle={{ marginBottom: theme.margins.xs }}
43
- >
44
- <View
45
- style={{
46
- width: 15,
47
- backgroundColor: theme.colors.green[250],
48
- borderTopLeftRadius: theme.borderWidths.thick_medium,
49
- borderBottomLeftRadius: theme.borderWidths.thick_medium,
50
- }}
51
- />
52
- <Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings["2xs"] }}>
53
- <Box
54
- marginStyle={{ marginTop: 4 }}
55
- flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
56
- >
57
- <Typography
58
- text={`LAVAGEM #`}
59
- color={theme.colors.black[25]}
60
- fontFamily={theme.fonts.inter_bold}
61
- size={theme.fontSizes.md}
62
- />
63
- <Typography
64
- text={`${numero}`}
65
- color={theme.colors.black[25]}
66
- fontFamily={theme.fonts.inter_bold}
67
- size={theme.fontSizes.md}
68
- />
69
- </Box>
70
-
71
- <Box
72
- marginStyle={{ marginTop: 4 }}
73
- flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
74
- >
75
- <Typography
76
- text={`Data de registro: `}
77
- color={theme.colors.black[25]}
78
- fontFamily={theme.fonts.inter_medium_500}
79
- size={theme.fontSizes.xs}
80
- />
81
- <Typography
82
- text={`${dataRegistro}`}
83
- color={theme.colors.gray[700]}
84
- fontFamily={theme.fonts.inter_regular_400}
85
- size={theme.fontSizes.xs}
86
- />
87
- </Box>
88
-
89
- <Box
90
- marginStyle={{ marginTop: 4 }}
91
- flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
92
- >
93
- <Typography
94
- text={`Cavalo: `}
95
- color={theme.colors.black[25]}
96
- fontFamily={theme.fonts.inter_medium_500}
97
- size={theme.fontSizes.xs}
98
- />
99
- <Typography
100
- text={`${cavalo}`}
101
- color={theme.colors.gray[700]}
102
- fontFamily={theme.fonts.inter_regular_400}
103
- size={theme.fontSizes.xs}
104
- />
105
- </Box>
106
-
107
- <Box
108
- borderStyled={{
109
- borderWidth: 1,
110
- borderColor: theme.colors.black[25],
111
- borderRadius: theme.borderWidths.thick_medium,
112
- }}
113
- flexStyle={{
114
- justifyContent: "center",
115
- alignItems: "center",
116
- }}
117
- >
118
- <Image
119
- source={{ uri: imagemUrl ?? "https://placehold.co/300x300" }}
120
- style={{
121
- width: "100%",
122
- height: 139,
123
- borderRadius: theme.borderWidths.thick_medium,
124
- }}
125
- resizeMode="cover"
126
- />
127
- </Box>
128
- </Box>
129
- </Box>
130
- </TouchableOpacity>
131
-
132
- <ModalMaintenance
133
- visible={showModal}
134
- onClose={() => setShowModal(false)}
135
- imagemUrl={imagemUrl}
136
- dataRegistro={dataRegistro}
137
- descricao={descricao}
138
- numero={7}
139
- />
140
- </>
141
- );
142
- };
143
-
144
- CardMaintenance.displayName = "CardMaintenance";
145
-
146
- export default asBaseComponent(CardMaintenance);
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React, { forwardRef, useState } from "react";
5
+
6
+ import { Image, View, TouchableOpacity } from "react-native";
7
+
8
+ import ModalMaintenance from "../modal-maintenance";
9
+
10
+ // components
11
+ import Box from "../../components/box";
12
+ import Typography from "../../components/typography";
13
+
14
+ // theme
15
+ import { theme } from "../../styles/theme/theme";
16
+
17
+ // typings
18
+ import type { ICardMaintenance } from "./interface";
19
+ import { asBaseComponent } from "../../@types/as-base-component";
20
+ import { getStatusColorHex } from "../../utils/get-status-color";
21
+
22
+ /**
23
+ * COMPONENT
24
+ */
25
+
26
+ const CardMaintenance = forwardRef<any, ICardMaintenance>((props, ref): React.ReactElement => {
27
+ const { numero, dataRegistro, cavalo, imagemUrl, descricao, status, titutlo } = props;
28
+ const [showModal, setShowModal] = useState(false);
29
+
30
+ return (
31
+ <>
32
+ <TouchableOpacity ref={ref} onPress={() => setShowModal(true)} activeOpacity={0.9}>
33
+ <Box
34
+ width={"100%"}
35
+ flexStyle={{ flexDirection: "row" }}
36
+ backgroundColor={theme.colors.neutral[25]}
37
+ borderStyled={{
38
+ borderRadius: theme.borderWidths.thick_medium,
39
+ }}
40
+ marginStyle={{ marginBottom: theme.margins.xs }}
41
+ >
42
+ <View
43
+ style={{
44
+ width: 15,
45
+ backgroundColor: getStatusColorHex(status) ?? theme.colors.green[250],
46
+ borderTopLeftRadius: theme.borderWidths.thick_medium,
47
+ borderBottomLeftRadius: theme.borderWidths.thick_medium,
48
+ }}
49
+ />
50
+ <Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings["2xs"] }}>
51
+ <Box
52
+ marginStyle={{ marginTop: 4 }}
53
+ flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
54
+ >
55
+ <Typography
56
+ text={`${titutlo ?? "LAVAGEM"} #`}
57
+ color={theme.colors.black[25]}
58
+ fontFamily={theme.fonts.inter_bold}
59
+ size={theme.fontSizes.md}
60
+ />
61
+ <Typography
62
+ text={`${numero}`}
63
+ color={theme.colors.black[25]}
64
+ fontFamily={theme.fonts.inter_bold}
65
+ size={theme.fontSizes.md}
66
+ />
67
+ </Box>
68
+
69
+ <Box
70
+ marginStyle={{ marginTop: 4 }}
71
+ flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
72
+ >
73
+ <Typography
74
+ text={`Data de registro: `}
75
+ color={theme.colors.black[25]}
76
+ fontFamily={theme.fonts.inter_medium_500}
77
+ size={theme.fontSizes.xs}
78
+ />
79
+ <Typography
80
+ text={`${dataRegistro}`}
81
+ color={theme.colors.gray[700]}
82
+ fontFamily={theme.fonts.inter_regular_400}
83
+ size={theme.fontSizes.xs}
84
+ />
85
+ </Box>
86
+
87
+ <Box
88
+ marginStyle={{ marginTop: 4, marginBottom: 8 }}
89
+ flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
90
+ >
91
+ <Typography
92
+ text={`Cavalo: `}
93
+ color={theme.colors.black[25]}
94
+ fontFamily={theme.fonts.inter_medium_500}
95
+ size={theme.fontSizes.xs}
96
+ />
97
+ <Typography
98
+ text={`${cavalo}`}
99
+ color={theme.colors.gray[700]}
100
+ fontFamily={theme.fonts.inter_regular_400}
101
+ size={theme.fontSizes.xs}
102
+ />
103
+ </Box>
104
+
105
+ <Box
106
+ borderStyled={{
107
+ borderWidth: 1,
108
+ borderColor: theme.colors.black[25],
109
+ borderRadius: theme.borderWidths.thick_medium,
110
+ }}
111
+ flexStyle={{
112
+ justifyContent: "center",
113
+ alignItems: "center",
114
+ }}
115
+ >
116
+ <Image
117
+ source={{ uri: imagemUrl ?? "https://placehold.co/300x300" }}
118
+ style={{
119
+ width: "100%",
120
+ height: 139,
121
+ borderRadius: theme.borderWidths.thick_medium,
122
+ }}
123
+ resizeMode="cover"
124
+ />
125
+ </Box>
126
+ </Box>
127
+ </Box>
128
+ </TouchableOpacity>
129
+
130
+ <ModalMaintenance
131
+ visible={showModal}
132
+ onClose={() => setShowModal(false)}
133
+ imagemUrl={imagemUrl}
134
+ dataRegistro={dataRegistro}
135
+ descricao={descricao}
136
+ numero={7}
137
+ status={status}
138
+ />
139
+ </>
140
+ );
141
+ });
142
+
143
+ CardMaintenance.displayName = "CardMaintenance";
144
+
145
+ export default asBaseComponent(CardMaintenance);
@@ -1,8 +1,33 @@
1
- export interface ICardMaintenance {
2
- numero: number;
3
- dataRegistro: string;
4
- cavalo: string;
5
- corBarra?: string;
6
- imagemUrl?: string;
7
- descricao: string;
8
- }
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ interface ICardMaintenance {
5
+ /**título do card */
6
+ titutlo?: string;
7
+
8
+ /**número da manutenção */
9
+ numero: number;
10
+
11
+ /**data de registro da manutenção */
12
+ dataRegistro: string;
13
+
14
+ /**identificação do cavalo que realizou a manutenção */
15
+ cavalo: string;
16
+
17
+ /**cor da barra lateral do card */
18
+ corBarra?: string;
19
+
20
+ /**image capturada para informar a manutenção */
21
+ imagemUrl?: string;
22
+
23
+ /**descrição da solicitação de manutençao */
24
+ descricao: string;
25
+
26
+ /**status da manutenção */
27
+ status: string;
28
+ }
29
+
30
+ /**
31
+ * EXPORTS
32
+ */
33
+ export { ICardMaintenance };