jornada-ui 0.4.17 → 0.4.19

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 (47) hide show
  1. package/lib/commonjs/components/list-supplies/index.js +132 -111
  2. package/lib/commonjs/components/list-supplies/index.js.map +1 -1
  3. package/lib/commonjs/components/modal-type-activities/index.js +7 -6
  4. package/lib/commonjs/components/modal-type-activities/index.js.map +1 -1
  5. package/lib/commonjs/components/modal-type-activities/mock/index.js +34 -3
  6. package/lib/commonjs/components/modal-type-activities/mock/index.js.map +1 -1
  7. package/lib/commonjs/components/notification-details-card/index.js +6 -6
  8. package/lib/commonjs/components/trip-details-card/index.js +218 -182
  9. package/lib/commonjs/components/trip-details-card/index.js.map +1 -1
  10. package/lib/commonjs/index.js +32 -32
  11. package/lib/module/components/list-supplies/index.js +134 -113
  12. package/lib/module/components/list-supplies/index.js.map +1 -1
  13. package/lib/module/components/modal-type-activities/index.js +8 -7
  14. package/lib/module/components/modal-type-activities/index.js.map +1 -1
  15. package/lib/module/components/modal-type-activities/mock/index.js +33 -2
  16. package/lib/module/components/modal-type-activities/mock/index.js.map +1 -1
  17. package/lib/module/components/notification-details-card/index.js +6 -6
  18. package/lib/module/components/trip-details-card/index.js +221 -184
  19. package/lib/module/components/trip-details-card/index.js.map +1 -1
  20. package/lib/module/index.js +4 -4
  21. package/lib/module/index.js.map +1 -1
  22. package/lib/typescript/commonjs/src/components/list-supplies/index.d.ts.map +1 -1
  23. package/lib/typescript/commonjs/src/components/modal-type-activities/index.d.ts.map +1 -1
  24. package/lib/typescript/commonjs/src/components/modal-type-activities/interface.d.ts +1 -0
  25. package/lib/typescript/commonjs/src/components/modal-type-activities/interface.d.ts.map +1 -1
  26. package/lib/typescript/commonjs/src/components/modal-type-activities/mock/index.d.ts +17 -0
  27. package/lib/typescript/commonjs/src/components/modal-type-activities/mock/index.d.ts.map +1 -1
  28. package/lib/typescript/commonjs/src/components/trip-details-card/index.d.ts.map +1 -1
  29. package/lib/typescript/commonjs/src/index.d.ts +4 -4
  30. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  31. package/lib/typescript/module/src/components/list-supplies/index.d.ts.map +1 -1
  32. package/lib/typescript/module/src/components/modal-type-activities/index.d.ts.map +1 -1
  33. package/lib/typescript/module/src/components/modal-type-activities/interface.d.ts +1 -0
  34. package/lib/typescript/module/src/components/modal-type-activities/interface.d.ts.map +1 -1
  35. package/lib/typescript/module/src/components/modal-type-activities/mock/index.d.ts +17 -0
  36. package/lib/typescript/module/src/components/modal-type-activities/mock/index.d.ts.map +1 -1
  37. package/lib/typescript/module/src/components/trip-details-card/index.d.ts.map +1 -1
  38. package/lib/typescript/module/src/index.d.ts +4 -4
  39. package/lib/typescript/module/src/index.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/src/components/list-supplies/index.tsx +178 -153
  42. package/src/components/modal-type-activities/index.tsx +173 -169
  43. package/src/components/modal-type-activities/interface.ts +36 -34
  44. package/src/components/modal-type-activities/mock/index.ts +103 -65
  45. package/src/components/notification-details-card/index.tsx +180 -180
  46. package/src/components/trip-details-card/index.tsx +65 -32
  47. package/src/index.tsx +4 -4
@@ -1,169 +1,173 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React, { forwardRef } from "react";
5
- import { Modal, TouchableOpacity, FlatList } from "react-native";
6
-
7
- // components
8
- import Box from "../box";
9
- import Button from "../button";
10
- import Typography from "../typography";
11
-
12
- // commons / icons
13
- import { Icons } from "../../common/icons-svg";
14
-
15
- // styles
16
- import { theme } from "../../styles/theme/theme";
17
-
18
- //typing
19
- import type { IModalTypeActivities, IActivity } from "./interface";
20
-
21
- // atividades
22
- import { activities } from "./mock";
23
-
24
- // utils
25
- import { getIconByProperty, type PropertyType } from "../../utils/get-icon-by-property";
26
- import { asBaseComponent } from "../../@types/as-base-component";
27
-
28
- const NUM_COLS = 3;
29
- const GUTTER = 8; // espaço horizontal entre botões
30
- const ROW_SPACE = 12; // espaço vertical entre linhas
31
-
32
- const ModalTest = forwardRef<any, IModalTypeActivities>(
33
- (
34
- { visible, onClose, handleSelectActivity, activityType, isLoading, style },
35
- ref
36
- ): React.ReactElement => {
37
- return (
38
- <Modal
39
- ref={ref}
40
- animationType="fade"
41
- transparent={true}
42
- onRequestClose={onClose}
43
- visible={visible}
44
- >
45
- <Box
46
- backgroundColor={"rgba(0, 0, 0, 0.7)"}
47
- flexStyle={{ flex: 1, justifyContent: "center", alignItems: "center" }}
48
- >
49
- <Box
50
- height={330}
51
- width={"92%"}
52
- backgroundColor={theme.colors.neutral[25]}
53
- borderStyled={{
54
- borderColor: theme.colors.blue[500],
55
- borderWidth: theme.borderWidths.thick,
56
- borderRadius: theme.borderWidths.thick_medium,
57
- }}
58
- paddingStyle={{
59
- padding: theme.paddings.md,
60
- }}
61
- style={{ position: "relative" }}
62
- >
63
- <Box
64
- width={"100%"}
65
- flexStyle={{
66
- flexDirection: "row",
67
- justifyContent: "space-between",
68
- alignItems: "center",
69
- }}
70
- >
71
- <Typography
72
- text="Atividades"
73
- size={theme.fontSizes.md}
74
- color={theme.colors.blue[500]}
75
- fontFamily={theme.fonts.inter_bold_700}
76
- lineHeight={theme.fontSizes.xl}
77
- />
78
-
79
- <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>
80
- <Icons icon="CLOSED" color={theme.colors.blue[500]} />
81
- </TouchableOpacity>
82
- </Box>
83
-
84
- {/* as atividades */}
85
- <Box
86
- marginStyle={{ marginTop: theme.margins["2xl"] }}
87
- flexStyle={{ flex: 1, justifyContent: "center", alignItems: "center" }}
88
- >
89
- <FlatList
90
- data={activities[activityType]}
91
- numColumns={NUM_COLS}
92
- keyExtractor={(item) => String(item.id)}
93
- scrollEnabled={false}
94
- renderItem={({ item, index }) => {
95
- const isLastCol = (index + 1) % NUM_COLS === 0;
96
-
97
- return (
98
- <TouchableOpacity
99
- style={{
100
- alignItems: "center",
101
- justifyContent: "flex-start",
102
- width: 110,
103
- marginRight: isLastCol ? 0 : GUTTER, // espaço entre colunas
104
- marginBottom: ROW_SPACE, // espaço entre linhas
105
- paddingVertical: 12,
106
- borderRadius: 8,
107
- }}
108
- onPress={() => handleSelectActivity(item as IActivity)}
109
- >
110
- {getIconByProperty(item.referencia as PropertyType)}
111
-
112
- <Typography
113
- text={item.descricao}
114
- size={theme.fontSizes.xs}
115
- color={theme.colors.blue[500]}
116
- lineHeight={theme.fontSizes.lg}
117
- fontFamily={theme.fonts.inter_medium_500}
118
- fontWeight="500"
119
- align="center"
120
- marginTop={5}
121
- numberOfLines={3} // <= limita a 2 linhas
122
- ellipsizeMode="tail" // <= se passar, coloca “...”
123
- />
124
- </TouchableOpacity>
125
- );
126
- }}
127
- />
128
- </Box>
129
-
130
- <Button
131
- title={"CANCELAR ATIVIDADE"}
132
- width="100%"
133
- height={40}
134
- activeOpacity={0.7}
135
- onPress={onClose}
136
- backgroundColor={theme.colors.blue[500]}
137
- buttonTextStyle={{
138
- color: theme.colors.neutral[25],
139
- fontFamily: theme.fonts.inter_medium_500,
140
- fontSize: theme.fontSizes.md,
141
- fontWeight: "500",
142
- }}
143
- flexStyle={{
144
- flexDirection: "row",
145
- alignItems: "center",
146
- justifyContent: "center",
147
- }}
148
- borderStyled={{
149
- borderWidth: theme.borderWidths.thin,
150
- borderColor: theme.colors.blue[500],
151
- borderRadius: theme.borderWidths.thick_medium,
152
- }}
153
- marginStyle={{ marginLeft: theme.margins.md }}
154
- isLoading={isLoading ?? false}
155
- style={[style, { position: "absolute", bottom: 10, left: 0 }]}
156
- />
157
- </Box>
158
- </Box>
159
- </Modal>
160
- );
161
- }
162
- );
163
-
164
- ModalTest.displayName = "ModalTest";
165
-
166
- /**
167
- * EXPORT
168
- */
169
- export default asBaseComponent(ModalTest);
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React, { forwardRef } from "react";
5
+ import { Modal, TouchableOpacity, FlatList } from "react-native";
6
+
7
+ // components
8
+ import Box from "../box";
9
+ import Button from "../button";
10
+ import Typography from "../typography";
11
+
12
+ // commons / icons
13
+ import { Icons } from "../../common/icons-svg";
14
+
15
+ // styles
16
+ import { theme } from "../../styles/theme/theme";
17
+
18
+ //typing
19
+ import type { IModalTypeActivities, IActivity } from "./interface";
20
+
21
+ // atividades
22
+ import { activities, activitiesReserva } from "./mock";
23
+
24
+ // utils
25
+ import { getIconByProperty, type PropertyType } from "../../utils/get-icon-by-property";
26
+ import { asBaseComponent } from "../../@types/as-base-component";
27
+
28
+ const NUM_COLS = 3;
29
+ const GUTTER = 8; // espaço horizontal entre botões
30
+ const ROW_SPACE = 12; // espaço vertical entre linhas
31
+
32
+ const ModalTest = forwardRef<any, IModalTypeActivities>(
33
+ (
34
+ { visible, onClose, driverType, handleSelectActivity, activityType, isLoading, style },
35
+ ref
36
+ ): React.ReactElement => {
37
+ return (
38
+ <Modal
39
+ ref={ref}
40
+ animationType="fade"
41
+ transparent={true}
42
+ onRequestClose={onClose}
43
+ visible={visible}
44
+ >
45
+ <Box
46
+ backgroundColor={"rgba(0, 0, 0, 0.7)"}
47
+ flexStyle={{ flex: 1, justifyContent: "center", alignItems: "center" }}
48
+ >
49
+ <Box
50
+ height={330}
51
+ width={"92%"}
52
+ backgroundColor={theme.colors.neutral[25]}
53
+ borderStyled={{
54
+ borderColor: theme.colors.blue[500],
55
+ borderWidth: theme.borderWidths.thick,
56
+ borderRadius: theme.borderWidths.thick_medium,
57
+ }}
58
+ paddingStyle={{
59
+ padding: theme.paddings.md,
60
+ }}
61
+ style={{ position: "relative" }}
62
+ >
63
+ <Box
64
+ width={"100%"}
65
+ flexStyle={{
66
+ flexDirection: "row",
67
+ justifyContent: "space-between",
68
+ alignItems: "center",
69
+ }}
70
+ >
71
+ <Typography
72
+ text="Atividades"
73
+ size={theme.fontSizes.md}
74
+ color={theme.colors.blue[500]}
75
+ fontFamily={theme.fonts.inter_bold_700}
76
+ lineHeight={theme.fontSizes.xl}
77
+ />
78
+
79
+ <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>
80
+ <Icons icon="CLOSED" color={theme.colors.blue[500]} />
81
+ </TouchableOpacity>
82
+ </Box>
83
+
84
+ {/* as atividades */}
85
+ <Box
86
+ marginStyle={{ marginTop: theme.margins["2xl"] }}
87
+ flexStyle={{ flex: 1, justifyContent: "center", alignItems: "flex-start" }}
88
+ >
89
+ <FlatList
90
+ data={
91
+ driverType === "normal"
92
+ ? activities[activityType]
93
+ : activitiesReserva[activityType]
94
+ }
95
+ numColumns={NUM_COLS}
96
+ keyExtractor={(item) => String(item.id)}
97
+ scrollEnabled={false}
98
+ renderItem={({ item, index }) => {
99
+ const isLastCol = (index + 1) % NUM_COLS === 0;
100
+
101
+ return (
102
+ <TouchableOpacity
103
+ style={{
104
+ alignItems: "center",
105
+ justifyContent: "flex-start",
106
+ width: 110,
107
+ marginRight: isLastCol ? 0 : GUTTER, // espaço entre colunas
108
+ marginBottom: ROW_SPACE, // espaço entre linhas
109
+ paddingVertical: 12,
110
+ borderRadius: 8,
111
+ }}
112
+ onPress={() => handleSelectActivity(item as IActivity)}
113
+ >
114
+ {getIconByProperty(item.referencia as PropertyType)}
115
+
116
+ <Typography
117
+ text={item.descricao}
118
+ size={theme.fontSizes.xs}
119
+ color={theme.colors.blue[500]}
120
+ lineHeight={theme.fontSizes.lg}
121
+ fontFamily={theme.fonts.inter_medium_500}
122
+ fontWeight="500"
123
+ align="center"
124
+ marginTop={5}
125
+ numberOfLines={3} // <= limita a 2 linhas
126
+ ellipsizeMode="tail" // <= se passar, coloca “...”
127
+ />
128
+ </TouchableOpacity>
129
+ );
130
+ }}
131
+ />
132
+ </Box>
133
+
134
+ <Button
135
+ title={"CANCELAR ATIVIDADE"}
136
+ width="100%"
137
+ height={40}
138
+ activeOpacity={0.7}
139
+ onPress={onClose}
140
+ backgroundColor={theme.colors.blue[500]}
141
+ buttonTextStyle={{
142
+ color: theme.colors.neutral[25],
143
+ fontFamily: theme.fonts.inter_medium_500,
144
+ fontSize: theme.fontSizes.md,
145
+ fontWeight: "500",
146
+ }}
147
+ flexStyle={{
148
+ flexDirection: "row",
149
+ alignItems: "center",
150
+ justifyContent: "center",
151
+ }}
152
+ borderStyled={{
153
+ borderWidth: theme.borderWidths.thin,
154
+ borderColor: theme.colors.blue[500],
155
+ borderRadius: theme.borderWidths.thick_medium,
156
+ }}
157
+ marginStyle={{ marginLeft: theme.margins.md }}
158
+ isLoading={isLoading ?? false}
159
+ style={[style, { position: "absolute", bottom: 10, left: 0 }]}
160
+ />
161
+ </Box>
162
+ </Box>
163
+ </Modal>
164
+ );
165
+ }
166
+ );
167
+
168
+ ModalTest.displayName = "ModalTest";
169
+
170
+ /**
171
+ * EXPORT
172
+ */
173
+ export default asBaseComponent(ModalTest);
@@ -1,34 +1,36 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import type { ModalProps } from "react-native";
5
- import type { IGlobalCss } from "../../styles/global/interface";
6
-
7
- // typing
8
- interface IActivity {
9
- id: number;
10
- referencia: string;
11
- cor_hex: string;
12
- descricao: string;
13
- tipo: "trabalho" | "descanso";
14
- }
15
-
16
- interface IModalTypeActivities extends ModalProps, IGlobalCss {
17
- /** função que fecha modal */
18
- onClose: () => void;
19
-
20
- /** tipo de atividades */
21
- activityType: IActivity["tipo"];
22
-
23
- /** se está carregando */
24
- isLoading: boolean;
25
-
26
- /** função que seleciona atividade */
27
- // eslint-disable-next-line no-unused-vars
28
- handleSelectActivity: (activity: IActivity) => void;
29
- }
30
-
31
- /**
32
- * EXPORTS
33
- */
34
- export type { IModalTypeActivities, IActivity };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import type { ModalProps } from "react-native";
5
+ import type { IGlobalCss } from "../../styles/global/interface";
6
+
7
+ // typing
8
+ interface IActivity {
9
+ id: number;
10
+ referencia: string;
11
+ cor_hex: string;
12
+ descricao: string;
13
+ tipo: "trabalho" | "descanso";
14
+ }
15
+
16
+ interface IModalTypeActivities extends ModalProps, IGlobalCss {
17
+ /** função que fecha modal */
18
+ onClose: () => void;
19
+
20
+ /** tipo de atividades */
21
+ activityType: IActivity["tipo"];
22
+
23
+ driverType?: "normal" | "reserva";
24
+
25
+ /** se está carregando */
26
+ isLoading: boolean;
27
+
28
+ /** função que seleciona atividade */
29
+ // eslint-disable-next-line no-unused-vars
30
+ handleSelectActivity: (activity: IActivity) => void;
31
+ }
32
+
33
+ /**
34
+ * EXPORTS
35
+ */
36
+ export type { IModalTypeActivities, IActivity };
@@ -1,65 +1,103 @@
1
- /**
2
- * dados para os tipos de atividades selecionado
3
- */
4
- export const activities = {
5
- trabalho: [
6
- {
7
- id: 1,
8
- referencia: "operacao_veiculo",
9
- cor_hex: "000000",
10
- descricao: "Operação com Veículo",
11
- tipo: "trabalho",
12
- },
13
- {
14
- id: 2,
15
- referencia: "aguardando_carga",
16
- cor_hex: "000000",
17
- descricao: "Em carga",
18
- tipo: "trabalho",
19
- },
20
- {
21
- id: 3,
22
- referencia: "aguardando_descarga",
23
- cor_hex: "000000",
24
- descricao: "Em Descarga",
25
- tipo: "trabalho",
26
- },
27
- {
28
- id: 8,
29
- referencia: "disposicao_veiculo_parado",
30
- cor_hex: "000000",
31
- descricao: "Disposição com Veículo Parado",
32
- tipo: "trabalho",
33
- },
34
- ],
35
- descanso: [
36
- {
37
- id: 9,
38
- referencia: "descanso",
39
- cor_hex: "000000",
40
- descricao: "Descanso",
41
- tipo: "descanso",
42
- },
43
- {
44
- id: 7,
45
- referencia: "refeicao",
46
- cor_hex: "000000",
47
- descricao: "Refeição",
48
- tipo: "descanso",
49
- },
50
- {
51
- id: 6,
52
- referencia: "repouso_noturno",
53
- cor_hex: "000000",
54
- descricao: "Repouso Noturno",
55
- tipo: "descanso",
56
- },
57
- {
58
- id: 5,
59
- referencia: "repouso_semanal",
60
- cor_hex: "000000",
61
- descricao: "Repouso Semanal",
62
- tipo: "descanso",
63
- },
64
- ],
65
- };
1
+ /**
2
+ * dados para os tipos de atividades selecionado
3
+ */
4
+ export const activities = {
5
+ trabalho: [
6
+ {
7
+ id: 1,
8
+ referencia: "operacao_veiculo",
9
+ cor_hex: "000000",
10
+ descricao: "Operação com Veículo",
11
+ tipo: "trabalho",
12
+ },
13
+ {
14
+ id: 2,
15
+ referencia: "aguardando_carga",
16
+ cor_hex: "000000",
17
+ descricao: "Em carga",
18
+ tipo: "trabalho",
19
+ },
20
+ {
21
+ id: 3,
22
+ referencia: "aguardando_descarga",
23
+ cor_hex: "000000",
24
+ descricao: "Em Descarga",
25
+ tipo: "trabalho",
26
+ },
27
+ {
28
+ id: 8,
29
+ referencia: "disposicao_veiculo_parado",
30
+ cor_hex: "000000",
31
+ descricao: "Disposição com Veículo Parado",
32
+ tipo: "trabalho",
33
+ },
34
+ ],
35
+ descanso: [
36
+ {
37
+ id: 9,
38
+ referencia: "descanso",
39
+ cor_hex: "000000",
40
+ descricao: "Descanso",
41
+ tipo: "descanso",
42
+ },
43
+ {
44
+ id: 7,
45
+ referencia: "refeicao",
46
+ cor_hex: "000000",
47
+ descricao: "Refeição",
48
+ tipo: "descanso",
49
+ },
50
+ {
51
+ id: 6,
52
+ referencia: "repouso_noturno",
53
+ cor_hex: "000000",
54
+ descricao: "Repouso Noturno",
55
+ tipo: "descanso",
56
+ },
57
+ {
58
+ id: 5,
59
+ referencia: "repouso_semanal",
60
+ cor_hex: "000000",
61
+ descricao: "Repouso Semanal",
62
+ tipo: "descanso",
63
+ },
64
+ ],
65
+ };
66
+
67
+ export const activitiesReserva = {
68
+ trabalho: [
69
+ {
70
+ id: 10,
71
+ referencia: "reserva",
72
+ cor_hex: "000000",
73
+ descricao: "Disposição Reserva",
74
+ tipo: "trabalho",
75
+ },
76
+ ],
77
+ descanso: [
78
+ {
79
+ id: 6,
80
+ atividade_id: 6,
81
+ referencia: "repouso_noturno",
82
+ cor_hex: "000000",
83
+ descricao: "Repouso Noturno",
84
+ tipo: "descanso",
85
+ },
86
+ {
87
+ id: 7,
88
+ atividade_id: 7,
89
+ referencia: "refeicao",
90
+ cor_hex: "000000",
91
+ descricao: "Refeição",
92
+ tipo: "descanso",
93
+ },
94
+ {
95
+ id: 5,
96
+ atividade_id: 5,
97
+ referencia: "repouso_semanal",
98
+ cor_hex: "000000",
99
+ descricao: "Repouso Semanal",
100
+ tipo: "descanso",
101
+ },
102
+ ],
103
+ };