react-native-exp-fig 0.1.9 → 0.1.10

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 (52) hide show
  1. package/package.json +1 -1
  2. package/src/common/icons-svg/agent/index.tsx +40 -0
  3. package/src/common/icons-svg/bed/index.tsx +41 -0
  4. package/src/common/icons-svg/car/index.tsx +29 -0
  5. package/src/common/icons-svg/check-outline/index.tsx +42 -0
  6. package/src/common/icons-svg/coffee/index.tsx +43 -0
  7. package/src/common/icons-svg/constants/index.ts +63 -55
  8. package/src/common/icons-svg/index.tsx +255 -217
  9. package/src/common/icons-svg/pencil/index.tsx +32 -0
  10. package/src/common/icons-svg/refresh-ccw-dot/index.tsx +32 -0
  11. package/src/common/icons-svg/truck-activity/index.tsx +29 -0
  12. package/src/components/activities-daily/index.tsx +116 -0
  13. package/src/components/activities-daily/interface.d.ts +22 -0
  14. package/src/components/activities-progress/index.tsx +162 -0
  15. package/src/components/activities-progress/interface.d.ts +41 -0
  16. package/src/components/avatar-profile/index.tsx +95 -0
  17. package/src/components/avatar-profile/interface.d.ts +39 -0
  18. package/src/components/card-history/index.tsx +149 -150
  19. package/src/components/card-loading/index.tsx +16 -1
  20. package/src/components/card-work-session/index.tsx +187 -185
  21. package/src/components/check-box/index.tsx +94 -125
  22. package/src/components/check-box/interface.d.ts +31 -27
  23. package/src/components/coil/index.tsx +3 -3
  24. package/src/components/coil/interface.d.ts +1 -1
  25. package/src/components/filter-date-selector/index.tsx +101 -89
  26. package/src/components/history-details/index.tsx +100 -0
  27. package/src/components/history-details/interface.d.ts +18 -0
  28. package/src/components/image-capture-with-remove/index.tsx +8 -2
  29. package/src/components/image-capture-with-remove/interface.d.ts +3 -0
  30. package/src/components/notification-loading/index.tsx +18 -7
  31. package/src/components/notification-loading/interface.d.ts +4 -0
  32. package/src/components/profile-menu-option/index.tsx +65 -0
  33. package/src/components/profile-menu-option/interface.d.ts +42 -0
  34. package/src/components/step-indicator/index.tsx +164 -164
  35. package/src/components/step-indicator/interface.d.ts +34 -34
  36. package/src/components/user-profile/index.tsx +58 -70
  37. package/src/index.ts +42 -37
  38. package/src/stories/activities-daily/activities-daily.stories.tsx +40 -0
  39. package/src/stories/activities-progress/activities-progress.stories.tsx +61 -0
  40. package/src/stories/avatar-profile/avatar-profile.stories.tsx +32 -0
  41. package/src/stories/card-loading/card-loading.stories.tsx +2 -2
  42. package/src/stories/check-box/check-box.stories.tsx +81 -83
  43. package/src/stories/coil/coil.stories.tsx +26 -3
  44. package/src/stories/filter-date-selector/filter-date-selector.stories.tsx +122 -93
  45. package/src/stories/history-details/history-details.stories.tsx +36 -0
  46. package/src/stories/image-capture-with-remove/image-capture-with-remove.stories.tsx +10 -0
  47. package/src/stories/notification-loading/notification-loading.stories.tsx +15 -0
  48. package/src/stories/profile-menu-option/profile-menu-option.stories.tsx +70 -0
  49. package/src/stories/step-indicator/step-indicator.stories.tsx +124 -116
  50. package/src/styles/theme/theme.ts +2 -0
  51. package/src/utils/format-data/index.ts +66 -40
  52. package/src/utils/status-color/return-color.ts +12 -4
@@ -1,164 +1,164 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React from "react";
5
- import { View, Text } from "react-native";
6
-
7
- import { getIconKeyByValue } from "./helpers/get-icon-by-status";
8
-
9
- // typings
10
- import { IStepIndicator } from "./interface";
11
-
12
- // styles
13
- import { styles } from "./styles";
14
- import { Icons } from "../../common/icons-svg";
15
-
16
- /**
17
- * Componente StepIndicator para a interação da ui.
18
- */
19
-
20
- const StepIndicator: React.FC<IStepIndicator> = ({
21
- data = [],
22
- type,
23
- backgroundColorBall,
24
- textColorDescription,
25
- titleColor,
26
- titleNumberColor,
27
- }) => {
28
- const StepDefault = () => {
29
- return (
30
- <>
31
- {data!.length > 0 &&
32
- data!.map((history, index) => (
33
- <View testID="step-indicator" style={styles({}).containerIndicator} key={history.id}>
34
- <View style={styles({ backgroundColorBall }).containerBall}>
35
- {data!?.length > 1 && index < data!?.length - 1 && (
36
- <View
37
- style={{
38
- width: 2,
39
- height: 84,
40
- marginTop: 116,
41
- position: "relative",
42
- backgroundColor: "#050022",
43
- }}
44
- />
45
- )}
46
- <Text style={styles({ titleNumberColor }).titleNumber}>
47
- {data!?.length - index}
48
- </Text>
49
- </View>
50
-
51
- <View style={styles({}).containerMain}>
52
- <Text style={styles({ titleColor }).title}>{history?.titleLabel}</Text>
53
-
54
- {history?.data_inicio && (
55
- <Text style={styles({ textColorDescription }).titleDescription}>
56
- {`Inicio: ${history.data_inicio} ás ${history.data_fim}`}
57
- </Text>
58
- )}
59
-
60
- {history.description && (
61
- <Text style={styles({ textColorDescription }).titleDescription}>
62
- Duração: {history?.description}
63
- </Text>
64
- )}
65
- </View>
66
- </View>
67
- ))}
68
- </>
69
- );
70
- };
71
-
72
- const StepCustom = () => {
73
- return (
74
- <View
75
- style={{
76
- width: "100%",
77
- height: 84,
78
- paddingHorizontal: 24,
79
- display: "flex",
80
- flexDirection: "row",
81
- }}
82
- >
83
- {data.map((step, indexCustom) => {
84
- const titleLabel = getIconKeyByValue(step.titleLabel);
85
-
86
- return (
87
- <>
88
- <View
89
- key={String(Math.random() * 10)}
90
- style={{
91
- width: 45,
92
- height: 45,
93
- backgroundColor: indexCustom <= 3 ? "orange" : "transparent",
94
- borderRadius: 50,
95
- alignItems: "center",
96
- justifyContent: "center",
97
- borderWidth: 1,
98
- borderColor: "#fff",
99
- }}
100
- >
101
- <View
102
- style={{
103
- width: 45,
104
- height: 45,
105
- backgroundColor: "transparent",
106
- borderRadius: 50,
107
- alignItems: "center",
108
- justifyContent: "center",
109
- }}
110
- >
111
- {titleLabel && <Icons icon={titleLabel} />}
112
- </View>
113
- <Text
114
- style={{
115
- position: "absolute",
116
- top: 56,
117
- fontWeight: "600",
118
- fontSize: 10,
119
- lineHeight: 14,
120
- textAlign: "center",
121
- color: "#fff",
122
- }}
123
- >
124
- {step.titleLabel}
125
- </Text>
126
- </View>
127
-
128
- {data!?.length > 1 && indexCustom < data!?.length - 1 && (
129
- <View
130
- key={indexCustom}
131
- style={{
132
- width: 90,
133
- height: 2,
134
- marginTop: 24,
135
- position: "relative",
136
- backgroundColor: "orange",
137
- }}
138
- />
139
- )}
140
- </>
141
- );
142
- })}
143
- </View>
144
- );
145
- };
146
-
147
- const handleRenderComponent = (stepType: "default" | "custom") => {
148
- switch (stepType) {
149
- case "default":
150
- return <StepDefault />;
151
- case "custom":
152
- return <StepCustom />;
153
- default:
154
- return <View />;
155
- }
156
- };
157
-
158
- return <>{handleRenderComponent(type!)}</>;
159
- };
160
-
161
- /**
162
- * EXPORTS
163
- */
164
- export { StepIndicator };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React from "react";
5
+ import { View, Text } from "react-native";
6
+
7
+ import { getIconKeyByValue } from "./helpers/get-icon-by-status";
8
+
9
+ // typings
10
+ import { IStepIndicator } from "./interface";
11
+
12
+ // styles
13
+ import { styles } from "./styles";
14
+ import { Icons } from "../../common/icons-svg";
15
+ import { formHoursMinute } from "../../utils/format-data";
16
+
17
+ /**
18
+ * Componente StepIndicator para a interação da ui.
19
+ */
20
+
21
+ const StepIndicator: React.FC<IStepIndicator> = ({
22
+ data = [],
23
+ type,
24
+ backgroundColorBall,
25
+ textColorDescription,
26
+ titleColor,
27
+ titleNumberColor,
28
+ }) => {
29
+ const StepDefault = () => {
30
+ return (
31
+ <>
32
+ {data!.length > 0 &&
33
+ data!.map((history, index) => (
34
+ <View testID="step-indicator" style={styles({}).containerIndicator} key={history.id}>
35
+ <View style={styles({ backgroundColorBall }).containerBall}>
36
+ {data!?.length > 1 && index < data!?.length - 1 && (
37
+ <View
38
+ style={{
39
+ width: 2,
40
+ height: 84,
41
+ marginTop: 116,
42
+ position: "relative",
43
+ backgroundColor: "#050022",
44
+ }}
45
+ />
46
+ )}
47
+ <Text style={styles({ titleNumberColor }).titleNumber}>
48
+ {data!?.length - index}
49
+ </Text>
50
+ </View>
51
+
52
+ <View style={styles({}).containerMain}>
53
+ <Text style={styles({ titleColor }).title}>{history?.descricao}</Text>
54
+
55
+ {history?.data_inicio && (
56
+ <Text style={styles({ textColorDescription }).titleDescription}>
57
+ {`Inicio: ${history.data_inicio} ás ${history.data_fim}`}
58
+ </Text>
59
+ )}
60
+
61
+ {history.duracao_segundos && (
62
+ <Text style={styles({ textColorDescription }).titleDescription}>
63
+ Duração: {formHoursMinute(history?.duracao_segundos as string)}
64
+ </Text>
65
+ )}
66
+ </View>
67
+ </View>
68
+ ))}
69
+ </>
70
+ );
71
+ };
72
+
73
+ const StepCustom = () => {
74
+ return (
75
+ <View
76
+ style={{
77
+ width: "100%",
78
+ height: 84,
79
+ paddingHorizontal: 24,
80
+ display: "flex",
81
+ flexDirection: "row",
82
+ }}
83
+ >
84
+ {data.map((step, indexCustom) => {
85
+ const descricao = getIconKeyByValue(step.descricao);
86
+
87
+ return (
88
+ <React.Fragment key={`step-${indexCustom}`}>
89
+ <View
90
+ style={{
91
+ width: 45,
92
+ height: 45,
93
+ backgroundColor: indexCustom <= 3 ? "orange" : "transparent",
94
+ borderRadius: 50,
95
+ alignItems: "center",
96
+ justifyContent: "center",
97
+ borderWidth: 1,
98
+ borderColor: "#fff",
99
+ }}
100
+ >
101
+ <View
102
+ style={{
103
+ width: 45,
104
+ height: 45,
105
+ backgroundColor: "transparent",
106
+ borderRadius: 50,
107
+ alignItems: "center",
108
+ justifyContent: "center",
109
+ }}
110
+ >
111
+ {descricao && <Icons icon={descricao} />}
112
+ </View>
113
+ <Text
114
+ style={{
115
+ position: "absolute",
116
+ top: 56,
117
+ fontWeight: "600",
118
+ fontSize: 10,
119
+ lineHeight: 14,
120
+ textAlign: "center",
121
+ color: "#fff",
122
+ width: 75,
123
+ }}
124
+ >
125
+ {step.descricao}
126
+ </Text>
127
+ </View>
128
+
129
+ {data?.length > 1 && indexCustom < data?.length - 1 && (
130
+ <View
131
+ style={{
132
+ width: 35,
133
+ height: 2,
134
+ marginTop: 24,
135
+ position: "relative",
136
+ backgroundColor: "orange",
137
+ }}
138
+ />
139
+ )}
140
+ </React.Fragment>
141
+ );
142
+ })}
143
+ </View>
144
+ );
145
+ };
146
+
147
+ const handleRenderComponent = (stepType: "default" | "custom") => {
148
+ switch (stepType) {
149
+ case "default":
150
+ return <StepDefault />;
151
+ case "custom":
152
+ return <StepCustom />;
153
+ default:
154
+ return <View />;
155
+ }
156
+ };
157
+
158
+ return <>{handleRenderComponent(type!)}</>;
159
+ };
160
+
161
+ /**
162
+ * EXPORTS
163
+ */
164
+ export { StepIndicator };
@@ -1,34 +1,34 @@
1
- /**
2
- * IMPORTS
3
- */
4
-
5
- type IData = {
6
- id: number;
7
- titleLabel: string;
8
- data_inicio: string;
9
- data_fim: string;
10
- description: string;
11
- };
12
- interface IStepIndicator {
13
- /**dados que vão ser renderizados */
14
- data?: IData[];
15
-
16
- /**tupo de renderização padrão ou customizada */
17
- type?: "default" | "custom";
18
-
19
- /**tamanho do step indicator */
20
- backgroundColorBall?: string;
21
-
22
- /**cor do texto */
23
- titleColor?: string;
24
-
25
- /**cor do numero do step indicator */
26
- titleNumberColor?: string;
27
-
28
- /**cor do texto da descrição */
29
- textColorDescription?: string;
30
- }
31
- /**
32
- * EXPORTS
33
- */
34
- export { type IStepIndicator };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+
5
+ type IData = {
6
+ id: number;
7
+ duracao_segundos: string | number;
8
+ data_inicio: string;
9
+ data_fim: string;
10
+ descricao: string;
11
+ };
12
+ interface IStepIndicator {
13
+ /**dados que vão ser renderizados */
14
+ data?: IData[];
15
+
16
+ /**tupo de renderização padrão ou customizada */
17
+ type?: "default" | "custom";
18
+
19
+ /**tamanho do step indicator */
20
+ backgroundColorBall?: string;
21
+
22
+ /**cor do texto */
23
+ titleColor?: string;
24
+
25
+ /**cor do numero do step indicator */
26
+ titleNumberColor?: string;
27
+
28
+ /**cor do texto da descrição */
29
+ textColorDescription?: string;
30
+ }
31
+ /**
32
+ * EXPORTS
33
+ */
34
+ export { type IStepIndicator };
@@ -18,7 +18,6 @@ import { IUserProfile } from "./interface";
18
18
  import { theme } from "../../styles/theme/theme";
19
19
 
20
20
  /**
21
- *
22
21
  * Componente Header para a interação do usuário com ui.
23
22
  */
24
23
  const UserProfile: React.FC<IUserProfile> = ({
@@ -38,27 +37,20 @@ const UserProfile: React.FC<IUserProfile> = ({
38
37
  <Box
39
38
  testID={testID}
40
39
  width={width ?? "100%"}
41
- height={height ?? 260}
42
- backgroundColor={theme.colors.blue[500]}
43
- marginStyle={{ marginBottom: 16 }}
44
- paddingStyle={{ paddingLeft: 16, paddingRight: 16 }}
40
+ height={height}
41
+ backgroundColor={theme.colors.blue[525]}
42
+ paddingStyle={{
43
+ paddingLeft: theme.paddings.md,
44
+ paddingRight: theme.paddings.md,
45
+ paddingBottom: theme.paddings["2xs"],
46
+ }}
45
47
  >
46
48
  <Box
47
49
  width={"100%"}
48
50
  flexStyle={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }}
49
- paddingStyle={{ paddingTop: 28 }}
51
+ marginStyle={{ marginTop: theme.margins.md }}
50
52
  >
51
- <TouchableOpacity
52
- activeOpacity={0.7}
53
- style={{
54
- width: 100,
55
- height: 80,
56
- borderRadius: 50,
57
- alignItems: "center",
58
- justifyContent: "center",
59
- }}
60
- onPress={handleProfileView}
61
- >
53
+ <TouchableOpacity activeOpacity={0.7} onPress={handleProfileView}>
62
54
  <Image
63
55
  testID="user-profile-avatar"
64
56
  source={{
@@ -68,7 +60,7 @@ const UserProfile: React.FC<IUserProfile> = ({
68
60
  width: 120,
69
61
  height: 120,
70
62
  borderRadius: 60,
71
- borderWidth: 2,
63
+ borderWidth: theme.borderWidths.thin_medium,
72
64
  borderColor: theme.colors.green[400],
73
65
  }}
74
66
  />
@@ -77,54 +69,57 @@ const UserProfile: React.FC<IUserProfile> = ({
77
69
 
78
70
  <Box
79
71
  width={"100%"}
80
- height={70}
81
72
  flexStyle={{ flexDirection: "column", alignItems: "center", justifyContent: "center" }}
82
- marginStyle={{ marginTop: 36 }}
83
73
  >
84
74
  <Box
85
75
  width={"100%"}
86
- height={30}
87
76
  flexStyle={{
88
77
  flexDirection: "row",
89
78
  alignItems: "center",
90
79
  justifyContent: "flex-start",
91
80
  textAlign: "center",
92
81
  }}
82
+ paddingStyle={{ paddingTop: theme.paddings["2xs"] }}
93
83
  >
94
84
  <Typography
95
85
  text={"Olá, "}
96
86
  color={color?.colorText ?? theme.colors.neutral[25]}
97
87
  size={theme.fontSizes.md}
98
88
  fontFamily={theme.fonts.inter_regular_400}
99
- lineHeight={theme.fontSizes["2xl"] ?? 24}
100
- letterSpacing={"regular"}
101
- />
102
-
103
- <Typography
104
- text={nome}
105
- color={color?.colorText ?? theme.colors.neutral[25]}
106
- size={theme.fontSizes.sm}
107
- fontFamily="inter_medium_500"
108
- lineHeight={theme.fontSizes["2xl"] ?? 24}
89
+ fontWeight="400"
90
+ lineHeight={theme.fontSizes.lg ?? 18}
109
91
  letterSpacing={"regular"}
110
92
  />
93
+ <Box width={"89%"}>
94
+ <Typography
95
+ text={nome}
96
+ color={color?.colorText ?? theme.colors.neutral[25]}
97
+ size={theme.fontSizes.sm}
98
+ fontFamily="inter_medium_500"
99
+ fontWeight="500"
100
+ ellipsizeMode="tail"
101
+ numberOfLines={1}
102
+ lineHeight={theme.fontSizes.lg ?? 18}
103
+ letterSpacing={"regular"}
104
+ />
105
+ </Box>
111
106
  </Box>
112
107
  <Box
113
108
  width={"100%"}
114
- height={30}
115
109
  flexStyle={{
116
110
  flexDirection: "row",
117
111
  alignItems: "center",
118
112
  justifyContent: "flex-start",
119
113
  textAlign: "center",
120
114
  }}
115
+ paddingStyle={{ paddingTop: 5 }}
121
116
  >
122
117
  <Typography
123
118
  text={"CPF: "}
124
119
  color={color?.colorText ?? theme.colors.neutral[25]}
125
120
  size={theme.fontSizes.md}
126
121
  fontFamily={theme.fonts.inter_regular_400}
127
- lineHeight={theme.fontSizes["2xl"] ?? 24}
122
+ lineHeight={theme.fontSizes.lg ?? 18}
128
123
  letterSpacing={"regular"}
129
124
  />
130
125
 
@@ -132,36 +127,39 @@ const UserProfile: React.FC<IUserProfile> = ({
132
127
  text={cpf}
133
128
  color={color?.colorText ?? theme.colors.neutral[25]}
134
129
  size={theme.fontSizes.sm}
135
- fontFamily={theme.fonts.inter_medium_500}
136
- lineHeight={theme.fontSizes["2xl"] ?? 24}
130
+ fontFamily={theme.fonts.inter_semi_bold_600}
131
+ fontWeight="600"
132
+ lineHeight={theme.fontSizes.lg ?? 18}
137
133
  letterSpacing={"regular"}
138
134
  />
139
135
  </Box>
140
136
  <Box
141
137
  width={"100%"}
142
- height={30}
143
138
  flexStyle={{
144
139
  flexDirection: "row",
145
140
  alignItems: "center",
146
141
  justifyContent: "flex-start",
147
142
  textAlign: "center",
148
143
  }}
144
+ paddingStyle={{ paddingTop: 5 }}
149
145
  >
150
146
  <Typography
151
147
  text={"CONECTADO: "}
152
148
  color={color?.colorText ?? theme.colors.neutral[25]}
153
- size={theme.fontSizes.xs}
149
+ size={theme.fontSizes.sm}
154
150
  fontFamily={theme.fonts.inter_medium_500}
155
- lineHeight={theme.fontSizes["2xl"] ?? 24}
151
+ fontWeight="500"
152
+ lineHeight={theme.fontSizes.lg ?? 18}
156
153
  letterSpacing={"regular"}
157
154
  />
158
155
 
159
156
  <Typography
160
157
  text={bluetoothIsConnected ? placa_cavalo : ""}
161
158
  color={theme.colors.green[400]}
162
- size={theme.fontSizes.xs}
159
+ size={theme.fontSizes.sm}
163
160
  fontFamily={theme.fonts.inter_bold_700}
164
- lineHeight={theme.fontSizes["2xl"] ?? 24}
161
+ fontWeight="700"
162
+ lineHeight={theme.fontSizes.lg ?? 18}
165
163
  letterSpacing={"regular"}
166
164
  />
167
165
  </Box>
@@ -169,42 +167,32 @@ const UserProfile: React.FC<IUserProfile> = ({
169
167
 
170
168
  <Box
171
169
  width={"100%"}
172
- height={30}
173
170
  flexStyle={{
174
171
  flexDirection: "row",
175
- alignItems: "flex-end",
172
+ alignItems: "center",
176
173
  justifyContent: "flex-end",
177
174
  }}
178
- marginStyle={{ marginTop: 16 }}
175
+ marginStyle={{ marginTop: theme.margins.md }}
179
176
  >
180
- <Box
181
- width={"100%"}
182
- height={30}
183
- flexStyle={{
184
- flexDirection: "row",
185
- alignItems: "center",
186
- justifyContent: "flex-end",
187
- textAlign: "center",
188
- }}
189
- >
190
- <Typography
191
- text={"Versão: "}
192
- color={color?.colorText ?? theme.colors.neutral[25]}
193
- size={theme.fontSizes.md}
194
- fontFamily={theme.fonts.inter_regular_400}
195
- lineHeight={15}
196
- letterSpacing={"regular"}
197
- />
177
+ <Typography
178
+ text={"Versão: "}
179
+ color={color?.colorText ?? theme.colors.neutral[25]}
180
+ size={theme.fontSizes.md}
181
+ fontFamily={theme.fonts.inter_regular_400}
182
+ fontWeight="400"
183
+ lineHeight={theme.fontSizes.lg ?? 18}
184
+ letterSpacing={"regular"}
185
+ />
198
186
 
199
- <Typography
200
- text={app_version}
201
- color={color?.colorText ?? theme.colors.neutral[25]}
202
- size={theme.fontSizes.xs}
203
- fontFamily={theme.fonts.inter_light_300}
204
- lineHeight={theme.fontSizes["2xl"] ?? 24}
205
- letterSpacing={"regular"}
206
- />
207
- </Box>
187
+ <Typography
188
+ text={app_version}
189
+ color={color?.colorText ?? theme.colors.neutral[25]}
190
+ size={theme.fontSizes.sm}
191
+ fontWeight="300"
192
+ fontFamily={theme.fonts.inter_light_300}
193
+ lineHeight={theme.fontSizes.lg ?? 18}
194
+ letterSpacing={"regular"}
195
+ />
208
196
  </Box>
209
197
  </Box>
210
198
  );