react-native-exp-fig 2.0.0 → 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 (68) 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/notification-card/index.js +12 -7
  8. package/lib/commonjs/components/notification-card/index.js.map +1 -1
  9. package/lib/commonjs/components/user-profile/index.js +9 -10
  10. package/lib/commonjs/components/user-profile/index.js.map +1 -1
  11. package/lib/commonjs/index.js +3 -3
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/stories/header-profile/header-profile.stories.js +7 -17
  14. package/lib/commonjs/stories/header-profile/header-profile.stories.js.map +1 -1
  15. package/lib/commonjs/stories/notification-card/notification-card.stories.js +200 -0
  16. package/lib/commonjs/stories/notification-card/notification-card.stories.js.map +1 -0
  17. package/lib/commonjs/stories/notification-loading/notification-loading.stories.js.map +1 -1
  18. package/lib/commonjs/styles/theme/theme.js +5 -5
  19. package/lib/commonjs/utils/status-color/return-color.js +2 -2
  20. package/lib/commonjs/utils/status-color/return-color.js.map +1 -1
  21. package/lib/module/components/box/index.js +4 -4
  22. package/lib/module/components/card-loading/index.js +27 -25
  23. package/lib/module/components/card-loading/index.js.map +1 -1
  24. package/lib/module/components/header-profile/index.js +68 -62
  25. package/lib/module/components/header-profile/index.js.map +1 -1
  26. package/lib/module/components/history-details/index.js +4 -4
  27. package/lib/module/components/notification-card/index.js +12 -7
  28. package/lib/module/components/notification-card/index.js.map +1 -1
  29. package/lib/module/components/user-profile/index.js +9 -10
  30. package/lib/module/components/user-profile/index.js.map +1 -1
  31. package/lib/module/index.js +3 -3
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/module/stories/header-profile/header-profile.stories.js +5 -16
  34. package/lib/module/stories/header-profile/header-profile.stories.js.map +1 -1
  35. package/lib/module/stories/notification-card/notification-card.stories.js +194 -0
  36. package/lib/module/stories/notification-card/notification-card.stories.js.map +1 -0
  37. package/lib/module/stories/notification-loading/notification-loading.stories.js.map +1 -1
  38. package/lib/module/styles/theme/theme.js +5 -5
  39. package/lib/module/utils/status-color/return-color.js +2 -2
  40. package/lib/module/utils/status-color/return-color.js.map +1 -1
  41. package/lib/typescript/src/components/card-loading/index.d.ts.map +1 -1
  42. package/lib/typescript/src/components/header-profile/index.d.ts +66 -5
  43. package/lib/typescript/src/components/header-profile/index.d.ts.map +1 -1
  44. package/lib/typescript/src/components/notification-card/index.d.ts.map +1 -1
  45. package/lib/typescript/src/components/notification-card/interface.d.ts +2 -1
  46. package/lib/typescript/src/components/notification-card/interface.d.ts.map +1 -1
  47. package/lib/typescript/src/components/user-profile/index.d.ts.map +1 -1
  48. package/lib/typescript/src/index.d.ts +1 -1
  49. package/lib/typescript/src/index.d.ts.map +1 -1
  50. package/lib/typescript/src/stories/header-profile/header-profile.stories.d.ts +1 -1
  51. package/lib/typescript/src/stories/header-profile/header-profile.stories.d.ts.map +1 -1
  52. package/lib/typescript/src/stories/notification-card/notification-card.stories.d.ts +14 -0
  53. package/lib/typescript/src/stories/notification-card/notification-card.stories.d.ts.map +1 -0
  54. package/package.json +1 -1
  55. package/src/components/box/index.tsx +49 -49
  56. package/src/components/card-loading/index.tsx +294 -290
  57. package/src/components/header-profile/index.tsx +148 -132
  58. package/src/components/header-profile/interface.d.ts +145 -57
  59. package/src/components/history-details/index.tsx +99 -99
  60. package/src/components/notification-card/index.tsx +127 -123
  61. package/src/components/notification-card/interface.ts +19 -18
  62. package/src/components/user-profile/index.tsx +206 -204
  63. package/src/index.ts +48 -48
  64. package/src/stories/header-profile/header-profile.stories.tsx +92 -103
  65. package/src/stories/notification-card/notification-card.stories.tsx +202 -0
  66. package/src/stories/notification-loading/notification-loading.stories.tsx +88 -88
  67. package/src/styles/theme/theme.ts +193 -193
  68. package/src/utils/status-color/return-color.ts +34 -34
@@ -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 };
package/src/index.ts CHANGED
@@ -1,48 +1,48 @@
1
- /**
2
- * EXPORTS
3
- */
4
-
5
- // Components
6
- export { Box } from "./components/box";
7
- export { Button } from "./components/button";
8
- export { StepIndicator } from "./components/step-indicator";
9
- export { Typography } from "./components/typography";
10
- export { Input } from "./components/input";
11
- export { CapturePhoto } from "./components/capture-photo";
12
- export { CardHours } from "./components/card-hours";
13
- export { SelectOption } from "./components/selects/select-option";
14
- export { Header } from "./components/header-profile";
15
- export { ScheduledJourneyIndicators } from "./components/scheduled-journey-indicators";
16
- export { CardScheduledJourney } from "./components/card-scheduled-journey";
17
- export { UserProfile } from "./components/user-profile";
18
- export { MenuItem } from "./components/menu-item";
19
- export { CardLoading } from "./components/card-loading";
20
- export { CardWorkSession } from "./components/card-work-session";
21
- export { LoadingProgress } from "./components/loading-progress";
22
- export { NoData } from "./components/no-data";
23
- export { FilterJourney } from "./components/filter-journey";
24
- export { Coil } from "./components/coil";
25
- export { FilterDateSelector } from "./components/filter-date-selector";
26
- export { CardHistory } from "./components/card-history";
27
- export { NotificationLoading } from "./components/notification-loading";
28
- export { CheckBox } from "./components/check-box";
29
- export { ImageCaptureWithRemove } from "./components/image-capture-with-remove";
30
- export { LoadingDetails } from "./components/loading-details";
31
- export { AvatarProfile } from "./components/avatar-profile";
32
- export { HistoryDetails } from "./components/history-details";
33
- export { ActivitiesDaily } from "./components/activities-daily";
34
- export { ActivitiesProgress } from "./components/activities-progress";
35
- export { ProfileMenuOption } from "./components/profile-menu-option";
36
- export { ModalActivities } from "./components/modal-activities";
37
- export { default as CardReport } from "./components/card-report";
38
- export { default as Loading } from "./components/loading";
39
- export { default as NotificationCard } from "./components/notification-card";
40
- export { default as LoadMoreDataFlatList } from "./components/load-more-data";
41
- export { default as AppList } from "./components/app-list";
42
-
43
- // Utilities
44
- export { multiply } from "./utils/mutiply";
45
- export { formatDate, getLastSevenDays, formHoursMinute } from "./utils/format-data";
46
-
47
- // Styles
48
- export { theme } from "./styles/theme/theme";
1
+ /**
2
+ * EXPORTS
3
+ */
4
+
5
+ // Components
6
+ export { Box } from "./components/box";
7
+ export { Button } from "./components/button";
8
+ export { StepIndicator } from "./components/step-indicator";
9
+ export { Typography } from "./components/typography";
10
+ export { Input } from "./components/input";
11
+ export { CapturePhoto } from "./components/capture-photo";
12
+ export { CardHours } from "./components/card-hours";
13
+ export { SelectOption } from "./components/selects/select-option";
14
+ export { default as HeaderNavigation } from "./components/header-profile";
15
+ export { ScheduledJourneyIndicators } from "./components/scheduled-journey-indicators";
16
+ export { CardScheduledJourney } from "./components/card-scheduled-journey";
17
+ export { UserProfile } from "./components/user-profile";
18
+ export { MenuItem } from "./components/menu-item";
19
+ export { CardLoading } from "./components/card-loading";
20
+ export { CardWorkSession } from "./components/card-work-session";
21
+ export { LoadingProgress } from "./components/loading-progress";
22
+ export { NoData } from "./components/no-data";
23
+ export { FilterJourney } from "./components/filter-journey";
24
+ export { Coil } from "./components/coil";
25
+ export { FilterDateSelector } from "./components/filter-date-selector";
26
+ export { CardHistory } from "./components/card-history";
27
+ export { NotificationLoading } from "./components/notification-loading";
28
+ export { CheckBox } from "./components/check-box";
29
+ export { ImageCaptureWithRemove } from "./components/image-capture-with-remove";
30
+ export { LoadingDetails } from "./components/loading-details";
31
+ export { AvatarProfile } from "./components/avatar-profile";
32
+ export { HistoryDetails } from "./components/history-details";
33
+ export { ActivitiesDaily } from "./components/activities-daily";
34
+ export { ActivitiesProgress } from "./components/activities-progress";
35
+ export { ProfileMenuOption } from "./components/profile-menu-option";
36
+ export { ModalActivities } from "./components/modal-activities";
37
+ export { default as CardReport } from "./components/card-report";
38
+ export { default as Loading } from "./components/loading";
39
+ export { default as NotificationCard } from "./components/notification-card";
40
+ export { default as LoadMoreDataFlatList } from "./components/load-more-data";
41
+ export { default as AppList } from "./components/app-list";
42
+
43
+ // Utilities
44
+ export { multiply } from "./utils/mutiply";
45
+ export { formatDate, getLastSevenDays, formHoursMinute } from "./utils/format-data";
46
+
47
+ // Styles
48
+ export { theme } from "./styles/theme/theme";