react-native-exp-fig 2.0.1 → 2.0.2

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 (49) hide show
  1. package/lib/commonjs/components/box/index.js +4 -4
  2. package/lib/commonjs/components/card-loading/index.js +26 -24
  3. package/lib/commonjs/components/card-loading/index.js.map +1 -1
  4. package/lib/commonjs/components/header-profile/index.js +69 -63
  5. package/lib/commonjs/components/header-profile/index.js.map +1 -1
  6. package/lib/commonjs/components/history-details/index.js +4 -4
  7. package/lib/commonjs/components/user-profile/index.js +9 -10
  8. package/lib/commonjs/components/user-profile/index.js.map +1 -1
  9. package/lib/commonjs/index.js +3 -3
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/stories/header-profile/header-profile.stories.js +7 -17
  12. package/lib/commonjs/stories/header-profile/header-profile.stories.js.map +1 -1
  13. package/lib/commonjs/styles/theme/theme.js +5 -5
  14. package/lib/commonjs/utils/status-color/return-color.js +2 -2
  15. package/lib/commonjs/utils/status-color/return-color.js.map +1 -1
  16. package/lib/module/components/box/index.js +4 -4
  17. package/lib/module/components/card-loading/index.js +27 -25
  18. package/lib/module/components/card-loading/index.js.map +1 -1
  19. package/lib/module/components/header-profile/index.js +68 -62
  20. package/lib/module/components/header-profile/index.js.map +1 -1
  21. package/lib/module/components/history-details/index.js +4 -4
  22. package/lib/module/components/user-profile/index.js +9 -10
  23. package/lib/module/components/user-profile/index.js.map +1 -1
  24. package/lib/module/index.js +3 -3
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/module/stories/header-profile/header-profile.stories.js +5 -16
  27. package/lib/module/stories/header-profile/header-profile.stories.js.map +1 -1
  28. package/lib/module/styles/theme/theme.js +5 -5
  29. package/lib/module/utils/status-color/return-color.js +2 -2
  30. package/lib/module/utils/status-color/return-color.js.map +1 -1
  31. package/lib/typescript/src/components/card-loading/index.d.ts.map +1 -1
  32. package/lib/typescript/src/components/header-profile/index.d.ts +66 -5
  33. package/lib/typescript/src/components/header-profile/index.d.ts.map +1 -1
  34. package/lib/typescript/src/components/user-profile/index.d.ts.map +1 -1
  35. package/lib/typescript/src/index.d.ts +1 -1
  36. package/lib/typescript/src/index.d.ts.map +1 -1
  37. package/lib/typescript/src/stories/header-profile/header-profile.stories.d.ts +1 -1
  38. package/lib/typescript/src/stories/header-profile/header-profile.stories.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/src/components/box/index.tsx +49 -49
  41. package/src/components/card-loading/index.tsx +294 -290
  42. package/src/components/header-profile/index.tsx +148 -132
  43. package/src/components/header-profile/interface.d.ts +145 -57
  44. package/src/components/history-details/index.tsx +99 -99
  45. package/src/components/user-profile/index.tsx +206 -204
  46. package/src/index.ts +48 -48
  47. package/src/stories/header-profile/header-profile.stories.tsx +92 -103
  48. package/src/styles/theme/theme.ts +193 -193
  49. package/src/utils/status-color/return-color.ts +34 -34
@@ -1,99 +1,99 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React from "react";
5
-
6
- // components
7
- import { Box } from "../box";
8
- import { Typography } from "../typography";
9
-
10
- // typings
11
- import { IHistoryDetails } from "./interface";
12
-
13
- // styles
14
- import { theme } from "../../styles/theme/theme";
15
-
16
- const HistoryDetails: React.FC<IHistoryDetails> = ({
17
- numero = "01020304050607",
18
- local = "Doca 1, Pátio 02 - Usimais (Ipatinga)",
19
- date = "24/03/2025",
20
- duracao = "00:30",
21
- }) => {
22
- return (
23
- <Box width="100%" borderStyled={{ borderRadius: 8 }} backgroundColor={theme.colors.blue[400]}>
24
- <Box
25
- flexStyle={{
26
- flexDirection: "column",
27
- justifyContent: "flex-start",
28
- alignItems: "flex-start",
29
- }}
30
- paddingStyle={{ padding: theme.paddings.xs }}
31
- >
32
- <Typography
33
- text={`Carregamento - #${numero}`}
34
- size={theme.fontSizes.sm}
35
- fontFamily={theme.fonts.inter_semi_bold_600}
36
- fontWeight="600"
37
- color={theme.colors.neutral[25]}
38
- lineHeight={theme.fontSizes.xl}
39
- letterSpacing={"regular"}
40
- />
41
-
42
- <Typography
43
- text={local}
44
- color={theme.colors.neutral[25]}
45
- size={theme.fontSizes.xs}
46
- lineHeight={theme.fontSizes.lg}
47
- fontFamily={theme.fonts.inter_regular_400}
48
- letterSpacing={"regular"}
49
- numberOfLines={1}
50
- />
51
- <Typography
52
- text={`Data carregamento: ${date}`}
53
- color={theme.colors.neutral[25]}
54
- size={theme.fontSizes.xs}
55
- fontFamily={theme.fonts.inter_regular_400}
56
- lineHeight={theme.fontSizes.lg}
57
- letterSpacing={"regular"}
58
- numberOfLines={1}
59
- />
60
- </Box>
61
-
62
- <Box height={1} backgroundColor={theme.colors.gray[950]} />
63
-
64
- <Box
65
- flexStyle={{
66
- flexDirection: "row",
67
- justifyContent: "space-between",
68
- alignItems: "center",
69
- }}
70
- paddingStyle={{ padding: theme.paddings.xs }}
71
- >
72
- <Typography
73
- text={"DURAÇÃO:"}
74
- color={theme.colors.neutral[25]}
75
- size={24}
76
- fontFamily={theme.fonts.inter_regular_400}
77
- fontWeight="400"
78
- lineHeight={theme.fontSizes["3xl"]}
79
- letterSpacing={"regular"}
80
- />
81
- <Typography
82
- text={duracao}
83
- color={theme.colors.neutral[25]}
84
- size={26}
85
- align="left"
86
- fontFamily={theme.fonts.inter_medium_500}
87
- fontWeight="500"
88
- lineHeight={theme.fontSizes["3xl"]}
89
- letterSpacing={"regular"}
90
- />
91
- </Box>
92
- </Box>
93
- );
94
- };
95
-
96
- /**
97
- * EXPORTS
98
- */
99
- export { HistoryDetails };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React from "react";
5
+
6
+ // components
7
+ import { Box } from "../box";
8
+ import { Typography } from "../typography";
9
+
10
+ // typings
11
+ import { IHistoryDetails } from "./interface";
12
+
13
+ // styles
14
+ import { theme } from "../../styles/theme/theme";
15
+
16
+ const HistoryDetails: React.FC<IHistoryDetails> = ({
17
+ numero = "01020304050607",
18
+ local = "Doca 1, Pátio 02 - Usimais (Ipatinga)",
19
+ date = "24/03/2025",
20
+ duracao = "00:30",
21
+ }) => {
22
+ return (
23
+ <Box width="100%" borderStyled={{ borderRadius: 8 }} backgroundColor={theme.colors.blue[400]}>
24
+ <Box
25
+ flexStyle={{
26
+ flexDirection: "column",
27
+ justifyContent: "flex-start",
28
+ alignItems: "flex-start",
29
+ }}
30
+ paddingStyle={{ padding: theme.paddings.xs }}
31
+ >
32
+ <Typography
33
+ text={`Carregamento - #${numero}`}
34
+ size={theme.fontSizes.sm}
35
+ fontFamily={theme.fonts.inter_semi_bold_600}
36
+ fontWeight="600"
37
+ color={theme.colors.neutral[25]}
38
+ lineHeight={theme.fontSizes.xl}
39
+ letterSpacing={"regular"}
40
+ />
41
+
42
+ <Typography
43
+ text={local}
44
+ color={theme.colors.neutral[25]}
45
+ size={theme.fontSizes.xs}
46
+ lineHeight={theme.fontSizes.lg}
47
+ fontFamily={theme.fonts.inter_regular_400}
48
+ letterSpacing={"regular"}
49
+ numberOfLines={1}
50
+ />
51
+ <Typography
52
+ text={`Data carregamento: ${date}`}
53
+ color={theme.colors.neutral[25]}
54
+ size={theme.fontSizes.xs}
55
+ fontFamily={theme.fonts.inter_regular_400}
56
+ lineHeight={theme.fontSizes.lg}
57
+ letterSpacing={"regular"}
58
+ numberOfLines={1}
59
+ />
60
+ </Box>
61
+
62
+ <Box height={1} backgroundColor={theme.colors.gray[950]} />
63
+
64
+ <Box
65
+ flexStyle={{
66
+ flexDirection: "row",
67
+ justifyContent: "space-between",
68
+ alignItems: "center",
69
+ }}
70
+ paddingStyle={{ padding: theme.paddings.xs }}
71
+ >
72
+ <Typography
73
+ text={"DURAÇÃO:"}
74
+ color={theme.colors.neutral[25]}
75
+ size={24}
76
+ fontFamily={theme.fonts.inter_regular_400}
77
+ fontWeight="400"
78
+ lineHeight={theme.fontSizes["3xl"]}
79
+ letterSpacing={"regular"}
80
+ />
81
+ <Typography
82
+ text={duracao}
83
+ color={theme.colors.neutral[25]}
84
+ size={26}
85
+ align="left"
86
+ fontFamily={theme.fonts.inter_medium_500}
87
+ fontWeight="500"
88
+ lineHeight={theme.fontSizes["3xl"]}
89
+ letterSpacing={"regular"}
90
+ />
91
+ </Box>
92
+ </Box>
93
+ );
94
+ };
95
+
96
+ /**
97
+ * EXPORTS
98
+ */
99
+ export { HistoryDetails };
@@ -1,204 +1,206 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React from "react";
5
- import { Image, TouchableOpacity } from "react-native";
6
-
7
- // components
8
- import { Box } from "../box";
9
- import { Typography } from "../typography";
10
-
11
- // comons / constants
12
- import { IMAGES } from "../../common/constants";
13
-
14
- // typings
15
- import { IUserProfile } from "./interface";
16
-
17
- // styles
18
- import { theme } from "../../styles/theme/theme";
19
-
20
- /**
21
- * Componente Header para a interação do usuário com ui.
22
- */
23
- const UserProfile: React.FC<IUserProfile> = ({
24
- nome,
25
- avatar,
26
- cpf,
27
- placa_cavalo,
28
- bluetoothIsConnected,
29
- app_version,
30
- color,
31
- width,
32
- height,
33
- handleProfileView,
34
- testID,
35
- }: IUserProfile) => {
36
- return (
37
- <Box
38
- testID={testID}
39
- width={width ?? "100%"}
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
- }}
47
- >
48
- <Box
49
- width={"100%"}
50
- flexStyle={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }}
51
- marginStyle={{ marginTop: theme.margins.md }}
52
- >
53
- <TouchableOpacity activeOpacity={0.7} onPress={handleProfileView}>
54
- <Image
55
- testID="user-profile-avatar"
56
- source={{
57
- uri: avatar || IMAGES.IMAGE_ANONIMA,
58
- }}
59
- style={{
60
- width: 120,
61
- height: 120,
62
- borderRadius: 60,
63
- borderWidth: theme.borderWidths.thin_medium,
64
- borderColor: theme.colors.green[400],
65
- }}
66
- />
67
- </TouchableOpacity>
68
- </Box>
69
-
70
- <Box
71
- width={"100%"}
72
- flexStyle={{ flexDirection: "column", alignItems: "center", justifyContent: "center" }}
73
- >
74
- <Box
75
- width={"100%"}
76
- flexStyle={{
77
- flexDirection: "row",
78
- alignItems: "center",
79
- justifyContent: "flex-start",
80
- textAlign: "center",
81
- }}
82
- paddingStyle={{ paddingTop: theme.paddings["2xs"] }}
83
- >
84
- <Typography
85
- text={"Olá, "}
86
- color={color?.colorText ?? theme.colors.neutral[25]}
87
- size={theme.fontSizes.md}
88
- fontFamily={theme.fonts.inter_regular_400}
89
- fontWeight="400"
90
- lineHeight={theme.fontSizes.lg ?? 18}
91
- letterSpacing={"regular"}
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>
106
- </Box>
107
- <Box
108
- width={"100%"}
109
- flexStyle={{
110
- flexDirection: "row",
111
- alignItems: "center",
112
- justifyContent: "flex-start",
113
- textAlign: "center",
114
- }}
115
- paddingStyle={{ paddingTop: 5 }}
116
- >
117
- <Typography
118
- text={"CPF: "}
119
- color={color?.colorText ?? theme.colors.neutral[25]}
120
- size={theme.fontSizes.md}
121
- fontFamily={theme.fonts.inter_regular_400}
122
- lineHeight={theme.fontSizes.lg ?? 18}
123
- letterSpacing={"regular"}
124
- />
125
-
126
- <Typography
127
- text={cpf}
128
- color={color?.colorText ?? theme.colors.neutral[25]}
129
- size={theme.fontSizes.sm}
130
- fontFamily={theme.fonts.inter_semi_bold_600}
131
- fontWeight="600"
132
- lineHeight={theme.fontSizes.lg ?? 18}
133
- letterSpacing={"regular"}
134
- />
135
- </Box>
136
- <Box
137
- width={"100%"}
138
- flexStyle={{
139
- flexDirection: "row",
140
- alignItems: "center",
141
- justifyContent: "flex-start",
142
- textAlign: "center",
143
- }}
144
- paddingStyle={{ paddingTop: 5 }}
145
- >
146
- <Typography
147
- text={"CONECTADO: "}
148
- color={color?.colorText ?? theme.colors.neutral[25]}
149
- size={theme.fontSizes.sm}
150
- fontFamily={theme.fonts.inter_medium_500}
151
- fontWeight="500"
152
- lineHeight={theme.fontSizes.lg ?? 18}
153
- letterSpacing={"regular"}
154
- />
155
-
156
- <Typography
157
- text={bluetoothIsConnected ? placa_cavalo : ""}
158
- color={theme.colors.green[400]}
159
- size={theme.fontSizes.sm}
160
- fontFamily={theme.fonts.inter_bold_700}
161
- fontWeight="700"
162
- lineHeight={theme.fontSizes.lg ?? 18}
163
- letterSpacing={"regular"}
164
- />
165
- </Box>
166
- </Box>
167
-
168
- <Box
169
- width={"100%"}
170
- flexStyle={{
171
- flexDirection: "row",
172
- alignItems: "center",
173
- justifyContent: "flex-end",
174
- }}
175
- marginStyle={{ marginTop: theme.margins.md }}
176
- >
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
- />
186
-
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
- />
196
- </Box>
197
- </Box>
198
- );
199
- };
200
-
201
- /**
202
- * EXPORTS
203
- */
204
- export { UserProfile };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React from "react";
5
+ import { Image, TouchableOpacity } from "react-native";
6
+
7
+ // components
8
+ import { Box } from "../box";
9
+ import { Typography } from "../typography";
10
+
11
+ // comons / constants
12
+ import { IMAGES } from "../../common/constants";
13
+
14
+ // typings
15
+ import { IUserProfile } from "./interface";
16
+
17
+ // styles
18
+ import { theme } from "../../styles/theme/theme";
19
+
20
+ /**
21
+ * Componente Header para a interação do usuário com ui.
22
+ */
23
+ const UserProfile: React.FC<IUserProfile> = ({
24
+ nome,
25
+ avatar,
26
+ cpf,
27
+ placa_cavalo,
28
+ app_version,
29
+ color,
30
+ width,
31
+ height,
32
+ handleProfileView,
33
+ testID,
34
+ }: IUserProfile) => {
35
+ return (
36
+ <Box
37
+ testID={testID}
38
+ width={width ?? "100%"}
39
+ height={height}
40
+ backgroundColor={theme.colors.blue[100]}
41
+ paddingStyle={{
42
+ paddingLeft: theme.paddings.md,
43
+ paddingRight: theme.paddings.md,
44
+ paddingBottom: theme.paddings["2xs"],
45
+ }}
46
+ >
47
+ <Box
48
+ width={"100%"}
49
+ flexStyle={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }}
50
+ marginStyle={{ marginTop: theme.margins.md }}
51
+ >
52
+ <TouchableOpacity activeOpacity={0.7} onPress={handleProfileView}>
53
+ <Image
54
+ testID="user-profile-avatar"
55
+ source={{
56
+ uri: avatar || IMAGES.IMAGE_ANONIMA,
57
+ }}
58
+ style={{
59
+ width: 120,
60
+ height: 120,
61
+ borderRadius: 60,
62
+ borderWidth: theme.borderWidths.thin_medium,
63
+ borderColor: theme.colors.green[400],
64
+ }}
65
+ />
66
+ </TouchableOpacity>
67
+ </Box>
68
+
69
+ <Box
70
+ width={"100%"}
71
+ flexStyle={{ flexDirection: "column", alignItems: "center", justifyContent: "center" }}
72
+ >
73
+ <Box
74
+ width={"100%"}
75
+ flexStyle={{
76
+ flexDirection: "row",
77
+ alignItems: "center",
78
+ justifyContent: "flex-start",
79
+ textAlign: "center",
80
+ }}
81
+ paddingStyle={{ paddingTop: theme.paddings["2xs"] }}
82
+ >
83
+ <Typography
84
+ text={"Olá, "}
85
+ color={color?.colorText ?? theme.colors.neutral[25]}
86
+ size={theme.fontSizes.md}
87
+ fontFamily={theme.fonts.inter_regular_400}
88
+ fontWeight="400"
89
+ lineHeight={theme.fontSizes.lg ?? 18}
90
+ letterSpacing={"regular"}
91
+ />
92
+ <Box width={"89%"}>
93
+ <Typography
94
+ text={nome}
95
+ color={color?.colorText ?? theme.colors.neutral[25]}
96
+ size={theme.fontSizes.sm}
97
+ fontFamily="inter_medium_500"
98
+ fontWeight="500"
99
+ ellipsizeMode="tail"
100
+ numberOfLines={1}
101
+ lineHeight={theme.fontSizes.lg ?? 18}
102
+ letterSpacing={"regular"}
103
+ />
104
+ </Box>
105
+ </Box>
106
+ <Box
107
+ width={"100%"}
108
+ flexStyle={{
109
+ flexDirection: "row",
110
+ alignItems: "center",
111
+ justifyContent: "flex-start",
112
+ textAlign: "center",
113
+ }}
114
+ paddingStyle={{ paddingTop: 5 }}
115
+ >
116
+ <Typography
117
+ text={"CPF: "}
118
+ color={color?.colorText ?? theme.colors.neutral[25]}
119
+ size={theme.fontSizes.md}
120
+ fontFamily={theme.fonts.inter_regular_400}
121
+ lineHeight={theme.fontSizes.lg ?? 18}
122
+ letterSpacing={"regular"}
123
+ />
124
+
125
+ <Typography
126
+ text={cpf}
127
+ color={color?.colorText ?? theme.colors.neutral[25]}
128
+ size={theme.fontSizes.sm}
129
+ fontFamily={theme.fonts.inter_semi_bold_600}
130
+ fontWeight="600"
131
+ lineHeight={theme.fontSizes.lg ?? 18}
132
+ letterSpacing={"regular"}
133
+ />
134
+ </Box>
135
+
136
+ {placa_cavalo && (
137
+ <Box
138
+ width={"100%"}
139
+ flexStyle={{
140
+ flexDirection: "row",
141
+ alignItems: "center",
142
+ justifyContent: "flex-start",
143
+ textAlign: "center",
144
+ }}
145
+ paddingStyle={{ paddingTop: 5 }}
146
+ >
147
+ <Typography
148
+ text={"CONECTADO: "}
149
+ color={color?.colorText ?? theme.colors.neutral[25]}
150
+ size={theme.fontSizes.sm}
151
+ fontFamily={theme.fonts.inter_medium_500}
152
+ fontWeight="500"
153
+ lineHeight={theme.fontSizes.lg ?? 18}
154
+ letterSpacing={"regular"}
155
+ />
156
+
157
+ <Typography
158
+ text={placa_cavalo}
159
+ color={theme.colors.green[400]}
160
+ size={theme.fontSizes.sm}
161
+ fontFamily={theme.fonts.inter_bold_700}
162
+ fontWeight="700"
163
+ lineHeight={theme.fontSizes.lg ?? 18}
164
+ letterSpacing={"regular"}
165
+ />
166
+ </Box>
167
+ )}
168
+ </Box>
169
+
170
+ <Box
171
+ width={"100%"}
172
+ flexStyle={{
173
+ flexDirection: "row",
174
+ alignItems: "center",
175
+ justifyContent: "flex-end",
176
+ }}
177
+ marginStyle={{ marginTop: theme.margins.md }}
178
+ >
179
+ <Typography
180
+ text={"Versão: "}
181
+ color={color?.colorText ?? theme.colors.neutral[25]}
182
+ size={theme.fontSizes.md}
183
+ fontFamily={theme.fonts.inter_regular_400}
184
+ fontWeight="400"
185
+ lineHeight={theme.fontSizes.lg ?? 18}
186
+ letterSpacing={"regular"}
187
+ />
188
+
189
+ <Typography
190
+ text={app_version}
191
+ color={color?.colorText ?? theme.colors.neutral[25]}
192
+ size={theme.fontSizes.sm}
193
+ fontWeight="300"
194
+ fontFamily={theme.fonts.inter_light_300}
195
+ lineHeight={theme.fontSizes.lg ?? 18}
196
+ letterSpacing={"regular"}
197
+ />
198
+ </Box>
199
+ </Box>
200
+ );
201
+ };
202
+
203
+ /**
204
+ * EXPORTS
205
+ */
206
+ export { UserProfile };