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
@@ -82,13 +82,13 @@ const Coil: React.FC<ICoil> = ({
82
82
  flexStyle={{ flexDirection: "row", alignItems: "center", justifyContent: "flex-end" }}
83
83
  height={70}
84
84
  >
85
- {status === "recused" && (
85
+ {status === "Cancelado" && (
86
86
  <Icons icon={"RECUSED"} size={32} background={backgroundColorIcon} />
87
87
  )}
88
- {status === "approved" && (
88
+ {status === "Concluido" && (
89
89
  <Icons icon={"CHECK_CIRCLE"} size={32} background={backgroundColorIcon} />
90
90
  )}
91
- {status === "pending" && (
91
+ {(status === "Pendente" || status === "Andamento") && (
92
92
  <Icons icon={"EXCLAMATION_CIRCLE"} size={32} background={backgroundColorIcon} />
93
93
  )}
94
94
  </Box>
@@ -17,7 +17,7 @@ interface ICoil extends ViewProps, IGlobalCss {
17
17
  handleNavigation: () => void;
18
18
 
19
19
  /**propriedade que indica status da bobina */
20
- status?: "recused" | "pending" | "approved";
20
+ status?: "Cancelado" | "Pendente" | "Concluido" | "Andamento";
21
21
  }
22
22
 
23
23
  /**
@@ -1,89 +1,101 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React from "react";
5
- import { TouchableOpacity, ActivityIndicator, FlatList } from "react-native";
6
-
7
- // components
8
- import { Box } from "../box";
9
- import { Typography } from "../typography";
10
-
11
- // styles
12
- import { theme } from "../../styles/theme/theme";
13
-
14
- //typing
15
- import { IFilterDateSelector, ISelectedDay } from "./interface";
16
-
17
- /**
18
- *
19
- * Componente FilterDateSelector para a interação do usuário com ui.
20
- */
21
- const FilterDateSelector: React.FC<IFilterDateSelector> = ({
22
- selectedDay,
23
- handleSelectedDay,
24
- days,
25
- isLoading,
26
- testID,
27
- }) => {
28
- const renderDayBlock = ({ item: day, index }: { item: ISelectedDay; index: number }) => {
29
- const isSelected = selectedDay && selectedDay.date === day.date;
30
- return (
31
- <TouchableOpacity
32
- disabled={isSelected}
33
- key={index}
34
- activeOpacity={0.7}
35
- onPress={() => handleSelectedDay(day)}
36
- >
37
- <Box
38
- testID={testID}
39
- width={60}
40
- height={75}
41
- flexStyle={{ alignItems: "center", justifyContent: "center" }}
42
- backgroundColor={isSelected ? theme.colors.blue[400] : theme.colors.gray[350]}
43
- borderStyled={{
44
- borderRadius: theme.borderWidths.thick_large,
45
- borderColor: isSelected ? theme.colors.blue[400] : theme.colors.gray[350],
46
- borderWidth: theme.borderWidths.thin,
47
- }}
48
- marginStyle={{ marginRight: theme.margins["2xs"] }}
49
- >
50
- {isSelected && isLoading ? (
51
- <ActivityIndicator size="small" color="white" />
52
- ) : (
53
- <>
54
- <Typography
55
- text={day.date.toString().padStart(2, "0")}
56
- size={theme.fontSizes.lg}
57
- color={theme.colors.neutral[25]}
58
- fontFamily={theme.fonts.inter_bold_700}
59
- />
60
- <Typography
61
- text={day.dayName.slice(0, 3)}
62
- size={theme.fontSizes.lg}
63
- color={theme.colors.neutral[25]}
64
- fontFamily={theme.fonts.inter_bold_700}
65
- letterSpacing="o_16"
66
- />
67
- </>
68
- )}
69
- </Box>
70
- </TouchableOpacity>
71
- );
72
- };
73
- const daySorted = days.sort(
74
- (a, b) => new Date(b.fullDate).getTime() - new Date(a.fullDate).getTime()
75
- );
76
- return (
77
- <FlatList
78
- horizontal
79
- data={daySorted}
80
- showsHorizontalScrollIndicator={false}
81
- renderItem={renderDayBlock}
82
- />
83
- );
84
- };
85
-
86
- /**
87
- * EXPORTS
88
- */
89
- export { FilterDateSelector };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React from "react";
5
+ import { TouchableOpacity, ActivityIndicator, FlatList } from "react-native";
6
+
7
+ // components
8
+ import { Box } from "../box";
9
+ import { Typography } from "../typography";
10
+
11
+ // styles
12
+ import { theme } from "../../styles/theme/theme";
13
+
14
+ //typing
15
+ import { IFilterDateSelector, ISelectedDay } from "./interface";
16
+ import { Icons } from "../../common/icons-svg";
17
+
18
+ /**
19
+ *
20
+ * Componente FilterDateSelector para a interação do usuário com ui.
21
+ */
22
+ const FilterDateSelector: React.FC<IFilterDateSelector> = ({
23
+ selectedDay,
24
+ handleSelectedDay,
25
+ days,
26
+ isLoading,
27
+ testID,
28
+ }) => {
29
+ const renderDayBlock = ({ item: day, index }: { item: ISelectedDay; index: number }) => {
30
+ const isSelected = selectedDay && selectedDay.date === day.date;
31
+ return (
32
+ <TouchableOpacity
33
+ disabled={isSelected}
34
+ key={index}
35
+ activeOpacity={0.7}
36
+ onPress={() => handleSelectedDay(day)}
37
+ >
38
+ <Box
39
+ testID={testID}
40
+ width={65}
41
+ height={75}
42
+ flexStyle={{ alignItems: "center", justifyContent: "center" }}
43
+ backgroundColor={isSelected ? theme.colors.blue[400] : theme.colors.gray[350]}
44
+ borderStyled={{
45
+ borderRadius: theme.borderWidths.thick_large,
46
+ borderColor: isSelected ? theme.colors.blue[400] : theme.colors.gray[350],
47
+ borderWidth: theme.borderWidths.thin,
48
+ }}
49
+ marginStyle={{ marginRight: theme.margins["2xs"], marginTop: theme.margins["2xs"] }}
50
+ >
51
+ {isSelected && isLoading ? (
52
+ <ActivityIndicator size="small" color="white" />
53
+ ) : (
54
+ <>
55
+ {day.date === "all" ? (
56
+ <Icons icon="REFRESH_CCW_DOT" color={theme.colors.neutral[25]} />
57
+ ) : (
58
+ <>
59
+ <Typography
60
+ text={day.date === "all" ? "" : day.date.toString().padStart(2, "0")}
61
+ size={theme.fontSizes.lg}
62
+ color={theme.colors.neutral[25]}
63
+ fontFamily={theme.fonts.inter_bold_700}
64
+ />
65
+ <Typography
66
+ text={day.date === "all" ? "Todos" : day.dayName.slice(0, 3)}
67
+ size={theme.fontSizes.lg}
68
+ color={theme.colors.neutral[25]}
69
+ fontFamily={theme.fonts.inter_bold_700}
70
+ marginBottom={day.date === "all" ? theme.margins["3xl"] : 0}
71
+ letterSpacing="o_16"
72
+ />
73
+ </>
74
+ )}
75
+ </>
76
+ )}
77
+ </Box>
78
+ </TouchableOpacity>
79
+ );
80
+ };
81
+ const daySorted = days.sort(
82
+ (a, b) => new Date(b.fullDate).getTime() - new Date(a.fullDate).getTime()
83
+ );
84
+
85
+ // Adiciona a opção "Todos" no início da lista
86
+ const dataWithAllOption = [...daySorted];
87
+
88
+ return (
89
+ <FlatList
90
+ horizontal
91
+ data={dataWithAllOption}
92
+ showsHorizontalScrollIndicator={false}
93
+ renderItem={renderDayBlock}
94
+ />
95
+ );
96
+ };
97
+
98
+ /**
99
+ * EXPORTS
100
+ */
101
+ export { FilterDateSelector };
@@ -0,0 +1,100 @@
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
+ import { formatDate } from "../../utils/format-data";
16
+
17
+ const HistoryDetails: React.FC<IHistoryDetails> = ({
18
+ numero = "01020304050607",
19
+ local = "Doca 1, Pátio 02 - Usimais (Ipatinga)",
20
+ date = "24/03/2025",
21
+ duracao = "00:30",
22
+ }) => {
23
+ return (
24
+ <Box width="100%" borderStyled={{ borderRadius: 8 }} backgroundColor={theme.colors.blue[400]}>
25
+ <Box
26
+ flexStyle={{
27
+ flexDirection: "column",
28
+ justifyContent: "flex-start",
29
+ alignItems: "flex-start",
30
+ }}
31
+ paddingStyle={{ padding: theme.paddings.xs }}
32
+ >
33
+ <Typography
34
+ text={`Carregamento - #${numero}`}
35
+ size={theme.fontSizes.sm}
36
+ fontFamily={theme.fonts.inter_semi_bold_600}
37
+ fontWeight="600"
38
+ color={theme.colors.neutral[25]}
39
+ lineHeight={theme.fontSizes.xl}
40
+ letterSpacing={"regular"}
41
+ />
42
+
43
+ <Typography
44
+ text={local}
45
+ color={theme.colors.neutral[25]}
46
+ size={theme.fontSizes.xs}
47
+ lineHeight={theme.fontSizes.lg}
48
+ fontFamily={theme.fonts.inter_regular_400}
49
+ letterSpacing={"regular"}
50
+ numberOfLines={1}
51
+ />
52
+ <Typography
53
+ text={`Data carregamento: ${formatDate(new Date(date))}`}
54
+ color={theme.colors.neutral[25]}
55
+ size={theme.fontSizes.xs}
56
+ fontFamily={theme.fonts.inter_regular_400}
57
+ lineHeight={theme.fontSizes.lg}
58
+ letterSpacing={"regular"}
59
+ numberOfLines={1}
60
+ />
61
+ </Box>
62
+
63
+ <Box height={1} backgroundColor={theme.colors.gray[950]} />
64
+
65
+ <Box
66
+ flexStyle={{
67
+ flexDirection: "row",
68
+ justifyContent: "space-between",
69
+ alignItems: "center",
70
+ }}
71
+ paddingStyle={{ padding: theme.paddings.xs }}
72
+ >
73
+ <Typography
74
+ text={"DURAÇÃO:"}
75
+ color={theme.colors.neutral[25]}
76
+ size={24}
77
+ fontFamily={theme.fonts.inter_regular_400}
78
+ fontWeight="400"
79
+ lineHeight={theme.fontSizes["3xl"]}
80
+ letterSpacing={"regular"}
81
+ />
82
+ <Typography
83
+ text={duracao}
84
+ color={theme.colors.neutral[25]}
85
+ size={26}
86
+ align="left"
87
+ fontFamily={theme.fonts.inter_medium_500}
88
+ fontWeight="500"
89
+ lineHeight={theme.fontSizes["3xl"]}
90
+ letterSpacing={"regular"}
91
+ />
92
+ </Box>
93
+ </Box>
94
+ );
95
+ };
96
+
97
+ /**
98
+ * EXPORTS
99
+ */
100
+ export { HistoryDetails };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ type IHistoryDetails = {
5
+ /**número do carregamento */
6
+ numero: string;
7
+ /**local onde vai ser o carregamento */
8
+ local: string;
9
+ /**data de quando o carregamento vai ser realizado */
10
+ date: string;
11
+ /**duração para o carregamento */
12
+ duracao: string;
13
+ };
14
+
15
+ /**
16
+ * EXPORTS
17
+ */
18
+ export { IHistoryDetails };
@@ -16,6 +16,9 @@ import { IImageCaptureWithRemoveProps } from "./interface";
16
16
  // styles
17
17
  import { theme } from "../../styles/theme/theme";
18
18
 
19
+ // utils
20
+ import { getBorderColor } from "../../utils/status-color/return-color";
21
+
19
22
  /**
20
23
  *
21
24
  * Componente ImageCaptureWithRemove para a interação do usuário com ui.
@@ -26,7 +29,10 @@ const ImageCaptureWithRemove: React.FC<IImageCaptureWithRemoveProps> = ({
26
29
  foto = null,
27
30
  handleTakePhoto,
28
31
  onRemove,
32
+ status,
29
33
  }: IImageCaptureWithRemoveProps) => {
34
+ const statusColor = status === "Cancelado" || status === "Pendente";
35
+
30
36
  return (
31
37
  <TouchableOpacity
32
38
  testID="image-capture-touchable"
@@ -41,9 +47,9 @@ const ImageCaptureWithRemove: React.FC<IImageCaptureWithRemoveProps> = ({
41
47
  flexStyle={{ flexDirection: "row", alignItems: "center", justifyContent: "center" }}
42
48
  testID="plus-icon-box"
43
49
  borderStyled={{
44
- borderWidth: 1,
50
+ borderWidth: statusColor ? theme.borderWidths.thick : theme.borderWidths.thin,
45
51
  borderRadius: theme.fontSizes.md,
46
- borderColor: theme.colors.blue[400],
52
+ borderColor: statusColor ? getBorderColor(status) : theme.colors.blue[400],
47
53
  }}
48
54
  >
49
55
  {foto ? (
@@ -14,6 +14,9 @@ type IImageCaptureWithRemoveProps = {
14
14
 
15
15
  /**Captura a imagem */
16
16
  handleTakePhoto: () => void;
17
+
18
+ /**Define o status das fotos */
19
+ status?: "Pendente" | "Concluido" | "Cancelado" | "Andamento";
17
20
  };
18
21
 
19
22
  /**
@@ -26,21 +26,26 @@ const NotificationLoading: React.FC<INotificationLoading> = ({
26
26
  notification,
27
27
  dataStart,
28
28
  style,
29
+ readonly,
29
30
  }) => {
30
- // const truncatedText = title.length > 13 ? title.substring(0, 11) + "..." : title;
31
31
  return (
32
- <TouchableOpacity activeOpacity={0.7} testID={testID} onPress={handleNavigation}>
32
+ <TouchableOpacity
33
+ activeOpacity={0.7}
34
+ testID={testID}
35
+ onPress={handleNavigation}
36
+ disabled={readonly}
37
+ >
33
38
  <Box
34
39
  width={"100%"}
35
40
  flexStyle={{ flexDirection: "row", alignItems: "center" }}
36
- backgroundColor={theme.colors.blue[400]}
41
+ backgroundColor={readonly ? theme.colors.blue[40050] : theme.colors.blue[400]}
37
42
  borderStyled={{
38
- borderWidth: 1,
43
+ borderWidth: theme.borderWidths.thin,
39
44
  borderRadius: theme.borderWidths.thick_medium,
40
- borderColor: theme.colors.blue[400],
45
+ borderColor: readonly ? theme.colors.blue[40050] : theme.colors.blue[400],
41
46
  }}
42
47
  paddingStyle={{ padding: theme.paddings["2xs"] }}
43
- style={[{ elevation: 5 }, style]}
48
+ style={style}
44
49
  >
45
50
  <Box width={"9%"}>
46
51
  <Icons icon={"BELL"} size={32} color={theme.colors.neutral[25]} />
@@ -117,7 +122,13 @@ const NotificationLoading: React.FC<INotificationLoading> = ({
117
122
  marginRight={8}
118
123
  />
119
124
 
120
- <Icons icon={"ELLIPSE"} color={getStatusColor(statusNotify as StatusType)} size={9} />
125
+ <Icons
126
+ icon={"ELLIPSE"}
127
+ color={
128
+ readonly ? theme.colors.neutral[25] : getStatusColor(statusNotify as StatusType)
129
+ }
130
+ size={9}
131
+ />
121
132
  </Box>
122
133
  </Box>
123
134
 
@@ -22,7 +22,11 @@ interface INotificationLoading extends ViewProps, IGlobalCss {
22
22
  /**propriedade que indica o status da notificação */
23
23
  statusNotify: string;
24
24
 
25
+ /**propriedade que indica a data da notificação */
25
26
  dataStart: string | Date;
27
+
28
+ /**propriedade que indica se a notificação está lida ou não */
29
+ readonly?: boolean;
26
30
  }
27
31
 
28
32
  /**
@@ -0,0 +1,65 @@
1
+ import React from "react";
2
+ import { TouchableOpacity } from "react-native";
3
+
4
+ // components
5
+ import { Box } from "../box";
6
+ import { Typography } from "../typography";
7
+
8
+ // icons
9
+ import { Icons } from "../../common/icons-svg";
10
+
11
+ // theme
12
+ import { theme } from "../../styles/theme/theme";
13
+
14
+ // typing
15
+ import { IProfileMenuOption } from "./interface";
16
+
17
+ const ProfileMenuOption: React.FC<IProfileMenuOption> = ({
18
+ handleNavigation,
19
+ icon,
20
+ text,
21
+ backgroundColor,
22
+ colorIcon,
23
+ }) => {
24
+ return (
25
+ <TouchableOpacity onPress={handleNavigation} activeOpacity={0.7}>
26
+ <Box
27
+ flexStyle={{
28
+ alignItems: "center",
29
+ flexDirection: "row",
30
+ justifyContent: "space-between",
31
+ }}
32
+ width={"100%"}
33
+ backgroundColor={backgroundColor ?? theme.colors.blue[400]}
34
+ paddingStyle={{ padding: theme.paddings["2xs"] }}
35
+ borderStyled={{
36
+ borderRadius: theme.borderWidths.thick_medium,
37
+ borderColor: theme.colors.blue[400],
38
+ }}
39
+ marginStyle={{ marginBottom: theme.margins.xs }}
40
+ >
41
+ <Box flexStyle={{ alignItems: "center", flexDirection: "row" }}>
42
+ <Icons icon={icon ?? "AGENT"} color={colorIcon ?? theme.colors.neutral[25]} />
43
+ <Typography
44
+ text={text}
45
+ size={theme.fontSizes.sm}
46
+ fontFamily={theme.fonts.inter_bold_700}
47
+ fontWeight={"700"}
48
+ lineHeight={theme.fontSizes.lg}
49
+ color={theme.colors.neutral[25]}
50
+ marginLeft={theme.margins.xs}
51
+ />
52
+ </Box>
53
+ <Typography
54
+ text="›"
55
+ size={theme.fontSizes["2xl"]}
56
+ fontFamily={theme.fonts.inter_medium_500}
57
+ fontWeight={"500"}
58
+ color={theme.colors.neutral[25]}
59
+ />
60
+ </Box>
61
+ </TouchableOpacity>
62
+ );
63
+ };
64
+
65
+ export { ProfileMenuOption };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import { TouchableOpacityProps } from "react-native";
5
+
6
+ // typing
7
+ import { IGlobalCss } from "../../styles/global/interface";
8
+
9
+ // svg
10
+ import { SVG_NAME } from "../../common/icons-svg/constants";
11
+
12
+ interface IProfileMenuOption extends TouchableOpacityProps, IGlobalCss {
13
+ /**
14
+ * nome do ícone
15
+ */
16
+ icon: keyof typeof SVG_NAME;
17
+
18
+ /**
19
+ * Propriedade texto do menu
20
+ */
21
+ text: string;
22
+
23
+ /**
24
+ * função de navegação
25
+ */
26
+ handleNavigation: () => void;
27
+
28
+ /**
29
+ * cor de fundo
30
+ */
31
+ backgroundColor?: string;
32
+
33
+ /**
34
+ * cor do ícone
35
+ */
36
+ colorIcon?: string;
37
+ }
38
+
39
+ /**
40
+ * EXPORTS
41
+ */
42
+ export { IProfileMenuOption };