jornada-ui 0.4.18 → 0.4.20

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 (180) hide show
  1. package/lib/commonjs/components/box/index.js +5 -5
  2. package/lib/commonjs/components/box/index.js.map +1 -1
  3. package/lib/commonjs/components/button/index.js +5 -5
  4. package/lib/commonjs/components/button/index.js.map +1 -1
  5. package/lib/commonjs/components/capture-photo/index.js +1 -1
  6. package/lib/commonjs/components/capture-photo/index.js.map +1 -1
  7. package/lib/commonjs/components/card-hours/index.js +5 -5
  8. package/lib/commonjs/components/card-hours/index.js.map +1 -1
  9. package/lib/commonjs/components/card-maintenance/index.js +3 -0
  10. package/lib/commonjs/components/card-maintenance/index.js.map +1 -1
  11. package/lib/commonjs/components/list-supplies/index.js +132 -111
  12. package/lib/commonjs/components/list-supplies/index.js.map +1 -1
  13. package/lib/commonjs/components/maintenance-description-input/index.js +5 -1
  14. package/lib/commonjs/components/maintenance-description-input/index.js.map +1 -1
  15. package/lib/commonjs/components/modal-maintenance/index.js +2 -0
  16. package/lib/commonjs/components/modal-maintenance/index.js.map +1 -1
  17. package/lib/commonjs/components/modal-type-activities/index.js +10 -4
  18. package/lib/commonjs/components/modal-type-activities/index.js.map +1 -1
  19. package/lib/commonjs/components/modals/modal-change-activitie-history/index.js +2 -0
  20. package/lib/commonjs/components/modals/modal-change-activitie-history/index.js.map +1 -1
  21. package/lib/commonjs/components/notification-details-card/index.js +6 -6
  22. package/lib/commonjs/components/report-bobinas/index.js +12 -6
  23. package/lib/commonjs/components/report-bobinas/index.js.map +1 -1
  24. package/lib/commonjs/components/resume-raking/index.js +5 -0
  25. package/lib/commonjs/components/resume-raking/index.js.map +1 -1
  26. package/lib/commonjs/components/step-indicator/index.js +12 -4
  27. package/lib/commonjs/components/step-indicator/index.js.map +1 -1
  28. package/lib/commonjs/components/toast-message/index.js +10 -6
  29. package/lib/commonjs/components/toast-message/index.js.map +1 -1
  30. package/lib/commonjs/components/toggle-fuel/index.js +1 -0
  31. package/lib/commonjs/components/toggle-fuel/index.js.map +1 -1
  32. package/lib/commonjs/components/trip-details-card/index.js +218 -182
  33. package/lib/commonjs/components/trip-details-card/index.js.map +1 -1
  34. package/lib/commonjs/components/typography/index.js +2 -0
  35. package/lib/commonjs/components/typography/index.js.map +1 -1
  36. package/lib/commonjs/components/user-journey-work-card/index.js +14 -0
  37. package/lib/commonjs/components/user-journey-work-card/index.js.map +1 -1
  38. package/lib/commonjs/components/user-profile/index.js +9 -1
  39. package/lib/commonjs/components/user-profile/index.js.map +1 -1
  40. package/lib/commonjs/components/weekly-hours-balance/index.js +2 -0
  41. package/lib/commonjs/components/weekly-hours-balance/index.js.map +1 -1
  42. package/lib/commonjs/index.js +32 -32
  43. package/lib/module/components/box/index.js +5 -5
  44. package/lib/module/components/box/index.js.map +1 -1
  45. package/lib/module/components/button/index.js +5 -5
  46. package/lib/module/components/button/index.js.map +1 -1
  47. package/lib/module/components/capture-photo/index.js +1 -1
  48. package/lib/module/components/capture-photo/index.js.map +1 -1
  49. package/lib/module/components/card-hours/index.js +5 -5
  50. package/lib/module/components/card-hours/index.js.map +1 -1
  51. package/lib/module/components/card-maintenance/index.js +3 -0
  52. package/lib/module/components/card-maintenance/index.js.map +1 -1
  53. package/lib/module/components/list-supplies/index.js +134 -113
  54. package/lib/module/components/list-supplies/index.js.map +1 -1
  55. package/lib/module/components/maintenance-description-input/index.js +5 -1
  56. package/lib/module/components/maintenance-description-input/index.js.map +1 -1
  57. package/lib/module/components/modal-maintenance/index.js +2 -0
  58. package/lib/module/components/modal-maintenance/index.js.map +1 -1
  59. package/lib/module/components/modal-type-activities/index.js +10 -4
  60. package/lib/module/components/modal-type-activities/index.js.map +1 -1
  61. package/lib/module/components/modals/modal-change-activitie-history/index.js +2 -0
  62. package/lib/module/components/modals/modal-change-activitie-history/index.js.map +1 -1
  63. package/lib/module/components/notification-details-card/index.js +6 -6
  64. package/lib/module/components/report-bobinas/index.js +12 -6
  65. package/lib/module/components/report-bobinas/index.js.map +1 -1
  66. package/lib/module/components/resume-raking/index.js +5 -0
  67. package/lib/module/components/resume-raking/index.js.map +1 -1
  68. package/lib/module/components/step-indicator/index.js +12 -4
  69. package/lib/module/components/step-indicator/index.js.map +1 -1
  70. package/lib/module/components/toast-message/index.js +10 -6
  71. package/lib/module/components/toast-message/index.js.map +1 -1
  72. package/lib/module/components/toggle-fuel/index.js +1 -0
  73. package/lib/module/components/toggle-fuel/index.js.map +1 -1
  74. package/lib/module/components/trip-details-card/index.js +221 -184
  75. package/lib/module/components/trip-details-card/index.js.map +1 -1
  76. package/lib/module/components/typography/index.js +2 -0
  77. package/lib/module/components/typography/index.js.map +1 -1
  78. package/lib/module/components/user-journey-work-card/index.js +14 -0
  79. package/lib/module/components/user-journey-work-card/index.js.map +1 -1
  80. package/lib/module/components/user-profile/index.js +9 -1
  81. package/lib/module/components/user-profile/index.js.map +1 -1
  82. package/lib/module/components/weekly-hours-balance/index.js +2 -0
  83. package/lib/module/components/weekly-hours-balance/index.js.map +1 -1
  84. package/lib/module/index.js +4 -4
  85. package/lib/module/index.js.map +1 -1
  86. package/lib/typescript/commonjs/src/components/box/index.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/components/button/index.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/components/capture-photo/index.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/src/components/card-hours/index.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/components/card-maintenance/index.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/src/components/list-supplies/index.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/src/components/maintenance-description-input/index.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/components/modal-maintenance/index.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/src/components/modal-type-activities/index.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/components/modal-type-activities/interface.d.ts +2 -0
  96. package/lib/typescript/commonjs/src/components/modal-type-activities/interface.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/components/modals/modal-change-activitie-history/index.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/src/components/modals/modal-change-activitie-history/interface.d.ts +4 -0
  99. package/lib/typescript/commonjs/src/components/modals/modal-change-activitie-history/interface.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/src/components/report-bobinas/index.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/src/components/resume-raking/index.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/src/components/resume-raking/interface.d.ts +13 -0
  103. package/lib/typescript/commonjs/src/components/resume-raking/interface.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/components/step-indicator/index.d.ts +3 -0
  105. package/lib/typescript/commonjs/src/components/step-indicator/index.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/components/toast-message/index.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/src/components/toast-message/interface.d.ts +1 -0
  108. package/lib/typescript/commonjs/src/components/toast-message/interface.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/src/components/toggle-fuel/index.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/src/components/trip-details-card/index.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/src/components/typography/index.d.ts +1 -0
  112. package/lib/typescript/commonjs/src/components/typography/index.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/src/components/user-journey-work-card/index.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/src/components/user-profile/index.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/src/components/weekly-hours-balance/index.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/src/index.d.ts +4 -4
  117. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  118. package/lib/typescript/module/src/components/box/index.d.ts.map +1 -1
  119. package/lib/typescript/module/src/components/button/index.d.ts.map +1 -1
  120. package/lib/typescript/module/src/components/capture-photo/index.d.ts.map +1 -1
  121. package/lib/typescript/module/src/components/card-hours/index.d.ts.map +1 -1
  122. package/lib/typescript/module/src/components/card-maintenance/index.d.ts.map +1 -1
  123. package/lib/typescript/module/src/components/list-supplies/index.d.ts.map +1 -1
  124. package/lib/typescript/module/src/components/maintenance-description-input/index.d.ts.map +1 -1
  125. package/lib/typescript/module/src/components/modal-maintenance/index.d.ts.map +1 -1
  126. package/lib/typescript/module/src/components/modal-type-activities/index.d.ts.map +1 -1
  127. package/lib/typescript/module/src/components/modal-type-activities/interface.d.ts +2 -0
  128. package/lib/typescript/module/src/components/modal-type-activities/interface.d.ts.map +1 -1
  129. package/lib/typescript/module/src/components/modals/modal-change-activitie-history/index.d.ts.map +1 -1
  130. package/lib/typescript/module/src/components/modals/modal-change-activitie-history/interface.d.ts +4 -0
  131. package/lib/typescript/module/src/components/modals/modal-change-activitie-history/interface.d.ts.map +1 -1
  132. package/lib/typescript/module/src/components/report-bobinas/index.d.ts.map +1 -1
  133. package/lib/typescript/module/src/components/resume-raking/index.d.ts.map +1 -1
  134. package/lib/typescript/module/src/components/resume-raking/interface.d.ts +13 -0
  135. package/lib/typescript/module/src/components/resume-raking/interface.d.ts.map +1 -1
  136. package/lib/typescript/module/src/components/step-indicator/index.d.ts +3 -0
  137. package/lib/typescript/module/src/components/step-indicator/index.d.ts.map +1 -1
  138. package/lib/typescript/module/src/components/toast-message/index.d.ts.map +1 -1
  139. package/lib/typescript/module/src/components/toast-message/interface.d.ts +1 -0
  140. package/lib/typescript/module/src/components/toast-message/interface.d.ts.map +1 -1
  141. package/lib/typescript/module/src/components/toggle-fuel/index.d.ts.map +1 -1
  142. package/lib/typescript/module/src/components/trip-details-card/index.d.ts.map +1 -1
  143. package/lib/typescript/module/src/components/typography/index.d.ts +1 -0
  144. package/lib/typescript/module/src/components/typography/index.d.ts.map +1 -1
  145. package/lib/typescript/module/src/components/user-journey-work-card/index.d.ts.map +1 -1
  146. package/lib/typescript/module/src/components/user-profile/index.d.ts.map +1 -1
  147. package/lib/typescript/module/src/components/weekly-hours-balance/index.d.ts.map +1 -1
  148. package/lib/typescript/module/src/index.d.ts +4 -4
  149. package/lib/typescript/module/src/index.d.ts.map +1 -1
  150. package/package.json +2 -1
  151. package/src/components/box/index.tsx +53 -53
  152. package/src/components/button/index.tsx +76 -76
  153. package/src/components/capture-photo/index.tsx +1 -1
  154. package/src/components/card-hours/index.tsx +121 -121
  155. package/src/components/card-maintenance/index.tsx +8 -2
  156. package/src/components/card-maintenance/interface.d.ts +4 -0
  157. package/src/components/list-supplies/index.tsx +178 -153
  158. package/src/components/maintenance-description-input/index.tsx +11 -4
  159. package/src/components/modal-maintenance/index.tsx +2 -1
  160. package/src/components/modal-maintenance/interface.d.ts +1 -0
  161. package/src/components/modal-type-activities/index.tsx +23 -5
  162. package/src/components/modal-type-activities/interface.ts +3 -0
  163. package/src/components/modals/modal-change-activitie-history/index.tsx +2 -1
  164. package/src/components/modals/modal-change-activitie-history/interface.ts +4 -0
  165. package/src/components/notification-details-card/index.tsx +180 -180
  166. package/src/components/report-bobinas/index.tsx +185 -175
  167. package/src/components/resume-raking/index.tsx +5 -1
  168. package/src/components/resume-raking/interface.ts +16 -0
  169. package/src/components/step-indicator/index.tsx +26 -8
  170. package/src/components/step-indicator/interface.d.ts +3 -0
  171. package/src/components/toast-message/index.tsx +77 -75
  172. package/src/components/toast-message/interface.ts +18 -17
  173. package/src/components/toggle-fuel/index.tsx +1 -0
  174. package/src/components/trip-details-card/index.tsx +65 -32
  175. package/src/components/typography/index.tsx +2 -0
  176. package/src/components/typography/interface.d.ts +104 -102
  177. package/src/components/user-journey-work-card/index.tsx +23 -2
  178. package/src/components/user-profile/index.tsx +10 -1
  179. package/src/components/weekly-hours-balance/index.tsx +2 -1
  180. package/src/index.tsx +4 -4
@@ -1,121 +1,121 @@
1
- /**
2
- * IMPORTS
3
- */ import React, { forwardRef } from "react";
4
-
5
- // components
6
- import Box from "../box";
7
- import Typography from "../typography";
8
-
9
- // typing
10
- import { asBaseComponent } from "../../@types/as-base-component";
11
- import { type ICardHoursProps } from "./interface";
12
-
13
- // styles
14
- import { theme } from "../../styles/theme/theme";
15
-
16
- const CardHours = forwardRef<any, ICardHoursProps>((props, ref): React.ReactElement => {
17
- const {
18
- testID,
19
- width,
20
- height,
21
- hoursWorked,
22
- flexStyle,
23
- marginStyle,
24
- paddingStyle,
25
- text,
26
- color,
27
- fontStyle,
28
- borderStyled,
29
- backgroundColor,
30
- sizeHours,
31
- sizeDescription,
32
- handleFormatDataInDayMonthYearNotHours,
33
- style,
34
- } = props;
35
-
36
- const styleProps = {
37
- testID,
38
- width,
39
- height,
40
- marginStyle,
41
- paddingStyle,
42
- flexStyle,
43
- text,
44
- borderStyled,
45
- color,
46
- fontStyle,
47
- backgroundColor,
48
- sizeHours,
49
- sizeDescription,
50
- style,
51
- } as ICardHoursProps;
52
- return (
53
- <Box
54
- ref={ref}
55
- testID={testID}
56
- width={width ?? "100%"}
57
- height={height}
58
- backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
59
- borderStyled={{
60
- borderWidth: borderStyled?.borderWidth ?? theme.borderWidths.thin,
61
- borderColor: borderStyled?.borderColor ?? theme.colors.gray[400],
62
- borderRadius: borderStyled?.borderRadius ?? theme.borderWidths.thick_medium,
63
- }}
64
- >
65
- <Typography
66
- text={text ?? "Informe texto:"}
67
- size={Number(styleProps.fontStyle?.fontSize)}
68
- fontFamily={styleProps.fontStyle?.fontFamily}
69
- color={color?.colorText ?? theme.colors.gray[700]}
70
- lineHeight={fontStyle?.lineHeight ?? theme.fontSizes.xl}
71
- letterSpacing={"regular"}
72
- paddingTop={theme.paddings["2xs"]}
73
- paddingLeft={theme.paddings["2xs"]}
74
- />
75
-
76
- <Box
77
- flexStyle={{
78
- flexDirection: "row",
79
- alignItems: "flex-end",
80
- justifyContent: "space-between",
81
- }}
82
- paddingStyle={{
83
- paddingLeft: theme.paddings["2xs"],
84
- paddingRight: theme.paddings["2xs"],
85
- }}
86
- backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
87
- width={"100%"}
88
- borderStyled={{
89
- borderBottomLeftRadius:
90
- borderStyled?.borderBottomLeftRadius ?? theme.borderWidths.thick_medium,
91
- borderBottomRightRadius:
92
- borderStyled?.borderBottomRightRadius ?? theme.borderWidths.thick_medium,
93
- }}
94
- >
95
- <Typography
96
- text={`${hoursWorked ?? "00:00 H"}`}
97
- size={sizeHours ?? theme.fontSizes["3xl"]}
98
- fontFamily={theme.fonts.inter_bold ?? "inter_bold"}
99
- fontWeight="700"
100
- color={color?.colorTextBold ?? theme.colors.orange[150]}
101
- lineHeight={fontStyle?.lineHeight ?? theme.fontSizes["5xl"]}
102
- letterSpacing={"regular"}
103
- />
104
-
105
- <Typography
106
- text={`Última atualização: ${handleFormatDataInDayMonthYearNotHours(new Date())}`}
107
- size={sizeDescription ?? theme.fontSizes.xs}
108
- fontFamily={"inter_light_300"}
109
- color={color?.colorTextData ?? theme.colors.gray[700]}
110
- lineHeight={fontStyle?.lineHeight ?? theme.fontSizes["xl"]}
111
- letterSpacing={"regular"}
112
- />
113
- </Box>
114
- </Box>
115
- );
116
- });
117
-
118
- /**
119
- * Componente CardHours para a interação da ui.
120
- */
121
- export default asBaseComponent(CardHours);
1
+ /**
2
+ * IMPORTS
3
+ */ import React, { forwardRef } from "react";
4
+
5
+ // components
6
+ import Box from "../box";
7
+ import Typography from "../typography";
8
+
9
+ // typing
10
+ import { asBaseComponent } from "../../@types/as-base-component";
11
+ import { type ICardHoursProps } from "./interface";
12
+
13
+ // styles
14
+ import { theme } from "../../styles/theme/theme";
15
+
16
+ const CardHours = forwardRef<any, ICardHoursProps>((props, ref): React.ReactElement => {
17
+ const {
18
+ testID,
19
+ width,
20
+ height,
21
+ hoursWorked,
22
+ flexStyle,
23
+ marginStyle,
24
+ paddingStyle,
25
+ text,
26
+ color,
27
+ fontStyle,
28
+ borderStyled,
29
+ backgroundColor,
30
+ sizeHours,
31
+ sizeDescription,
32
+ handleFormatDataInDayMonthYearNotHours,
33
+ style,
34
+ } = props;
35
+
36
+ const styleProps = {
37
+ testID,
38
+ width,
39
+ height,
40
+ marginStyle,
41
+ paddingStyle,
42
+ flexStyle,
43
+ text,
44
+ borderStyled,
45
+ color,
46
+ fontStyle,
47
+ backgroundColor,
48
+ sizeHours,
49
+ sizeDescription,
50
+ style,
51
+ } as ICardHoursProps;
52
+ return (
53
+ <Box
54
+ testID={testID}
55
+ ref={ref}
56
+ width={width ?? "100%"}
57
+ height={height}
58
+ backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
59
+ borderStyled={{
60
+ borderWidth: borderStyled?.borderWidth ?? theme.borderWidths.thin,
61
+ borderColor: borderStyled?.borderColor ?? theme.colors.gray[400],
62
+ borderRadius: borderStyled?.borderRadius ?? theme.borderWidths.thick_medium,
63
+ }}
64
+ >
65
+ <Typography
66
+ text={text ?? "Informe texto:"}
67
+ size={Number(styleProps.fontStyle?.fontSize)}
68
+ fontFamily={styleProps.fontStyle?.fontFamily}
69
+ color={color?.colorText ?? theme.colors.gray[700]}
70
+ lineHeight={fontStyle?.lineHeight ?? theme.fontSizes.xl}
71
+ letterSpacing={"regular"}
72
+ paddingTop={theme.paddings["2xs"]}
73
+ paddingLeft={theme.paddings["2xs"]}
74
+ />
75
+
76
+ <Box
77
+ flexStyle={{
78
+ flexDirection: "row",
79
+ alignItems: "flex-end",
80
+ justifyContent: "space-between",
81
+ }}
82
+ paddingStyle={{
83
+ paddingLeft: theme.paddings["2xs"],
84
+ paddingRight: theme.paddings["2xs"],
85
+ }}
86
+ backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
87
+ width={"100%"}
88
+ borderStyled={{
89
+ borderBottomLeftRadius:
90
+ borderStyled?.borderBottomLeftRadius ?? theme.borderWidths.thick_medium,
91
+ borderBottomRightRadius:
92
+ borderStyled?.borderBottomRightRadius ?? theme.borderWidths.thick_medium,
93
+ }}
94
+ >
95
+ <Typography
96
+ text={`${hoursWorked ?? "00:00 H"}`}
97
+ size={sizeHours ?? theme.fontSizes["3xl"]}
98
+ fontFamily={theme.fonts.inter_bold ?? "inter_bold"}
99
+ fontWeight="700"
100
+ color={color?.colorTextBold ?? theme.colors.orange[150]}
101
+ lineHeight={fontStyle?.lineHeight ?? theme.fontSizes["5xl"]}
102
+ letterSpacing={"regular"}
103
+ />
104
+
105
+ <Typography
106
+ text={`Última atualização: ${handleFormatDataInDayMonthYearNotHours(new Date())}`}
107
+ size={sizeDescription ?? theme.fontSizes.xs}
108
+ fontFamily={"inter_light_300"}
109
+ color={color?.colorTextData ?? theme.colors.gray[700]}
110
+ lineHeight={fontStyle?.lineHeight ?? theme.fontSizes["xl"]}
111
+ letterSpacing={"regular"}
112
+ />
113
+ </Box>
114
+ </Box>
115
+ );
116
+ });
117
+
118
+ /**
119
+ * Componente CardHours para a interação da ui.
120
+ */
121
+ export default asBaseComponent(CardHours);
@@ -24,12 +24,17 @@ import { getStatusColorHex } from "../../utils/get-status-color";
24
24
  */
25
25
 
26
26
  const CardMaintenance = forwardRef<any, ICardMaintenance>((props, ref): React.ReactElement => {
27
- const { numero, dataRegistro, cavalo, imagemUrl, descricao, status, titutlo } = props;
27
+ const { testID, numero, dataRegistro, cavalo, imagemUrl, descricao, status, titutlo } = props;
28
28
  const [showModal, setShowModal] = useState(false);
29
29
 
30
30
  return (
31
31
  <>
32
- <TouchableOpacity ref={ref} onPress={() => setShowModal(true)} activeOpacity={0.9}>
32
+ <TouchableOpacity
33
+ testID={testID}
34
+ ref={ref}
35
+ onPress={() => setShowModal(true)}
36
+ activeOpacity={0.9}
37
+ >
33
38
  <Box
34
39
  width={"100%"}
35
40
  flexStyle={{ flexDirection: "row" }}
@@ -128,6 +133,7 @@ const CardMaintenance = forwardRef<any, ICardMaintenance>((props, ref): React.Re
128
133
  </TouchableOpacity>
129
134
 
130
135
  <ModalMaintenance
136
+ testID={`${testID}-modal`}
131
137
  visible={showModal}
132
138
  onClose={() => setShowModal(false)}
133
139
  imagemUrl={imagemUrl}
@@ -2,6 +2,10 @@
2
2
  * IMPORTS
3
3
  */
4
4
  interface ICardMaintenance {
5
+ /**
6
+ * Identificador do componente
7
+ */
8
+ testID?: string;
5
9
  /**título do card */
6
10
  titutlo?: string;
7
11
 
@@ -1,153 +1,178 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React, { useEffect } from "react";
5
- import { Image, View, UIManager, Platform } from "react-native";
6
-
7
- // components
8
- import Box from "../../components/box";
9
- import Typography from "../../components/typography";
10
-
11
- // style
12
- import { theme } from "../../styles/theme/theme";
13
-
14
- // typings
15
- import type { IListSupplies } from "./interface";
16
- import { asBaseComponent } from "../../@types/as-base-component";
17
-
18
- const ListSupplies: React.FC<IListSupplies> = ({
19
- dataRegistro,
20
- namePosto,
21
- litragem,
22
- valor,
23
- imagemUrl,
24
- corBarra,
25
- }) => {
26
-
27
- useEffect(() => {
28
- if (Platform.OS === "android" && UIManager.setLayoutAnimationEnabledExperimental) {
29
- UIManager.setLayoutAnimationEnabledExperimental(true);
30
- }
31
- }, []);
32
-
33
- return (
34
- <Box
35
- width={"100%"}
36
- flexStyle={{ flexDirection: "row" }}
37
- backgroundColor={theme.colors.neutral[25]}
38
- borderStyled={{ borderRadius: theme.borderWidths.thick_medium }}
39
- >
40
- {/* faixa lateral */}
41
- <View
42
- style={{
43
- width: 15,
44
- backgroundColor: corBarra ?? theme.colors.blue[375],
45
- borderTopLeftRadius: theme.borderWidths.thick_medium,
46
- borderBottomLeftRadius: theme.borderWidths.thick_medium,
47
- }}
48
- />
49
-
50
- <Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings["2xs"] }}>
51
- <Box
52
- marginStyle={{ marginBottom: theme.margins.fn}}
53
- flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
54
- >
55
- <Typography
56
- text={`${namePosto || "Não informado"}`}
57
- color={theme.colors.black[25]}
58
- fontFamily={theme.fonts.inter_medium_500}
59
- size={theme.fontSizes.sm}
60
- />
61
- </Box>
62
-
63
- <Box
64
- marginStyle={{ marginBottom: theme.margins.fn}}
65
- flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
66
- >
67
- <Typography
68
- text="Litragem: "
69
- color={theme.colors.black[25]}
70
- fontFamily={theme.fonts.inter_medium_500}
71
- size={theme.fontSizes.sm}
72
- />
73
- <Box
74
- flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
75
- >
76
- <Typography
77
- text={`${litragem || "Não informado"}`}
78
- color={theme.colors.black[25]}
79
- fontFamily={theme.fonts.inter_regular_400}
80
- size={theme.fontSizes.sm}
81
- />
82
- <Typography
83
- text={` LT`}
84
- color={theme.colors.red[400]}
85
- fontFamily={theme.fonts.inter_regular_400}
86
- size={theme.fontSizes.sm}
87
- />
88
- </Box>
89
- </Box>
90
-
91
- <Box
92
- marginStyle={{ marginBottom: theme.margins.fn}}
93
- flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
94
- >
95
- <Typography
96
- text="Valor: "
97
- color={theme.colors.black[25]}
98
- fontFamily={theme.fonts.inter_medium_500}
99
- size={theme.fontSizes.sm}
100
- />
101
- <Typography
102
- text={`R$ ${valor || "Não informado"}`}
103
- color={theme.colors.gray[700]}
104
- fontFamily={theme.fonts.inter_regular_400}
105
- size={theme.fontSizes.sm}
106
- />
107
- </Box>
108
-
109
- <Box
110
- marginStyle={{ marginBottom: theme.margins.fn}}
111
- flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
112
- >
113
- <Typography
114
- text={"Data: "}
115
- color={theme.colors.black[25]}
116
- fontFamily={theme.fonts.inter_medium_500}
117
- size={theme.fontSizes.sm}
118
- />
119
- <Typography
120
- text={`${dataRegistro || "Não informado"}`}
121
- color={theme.colors.gray[700]}
122
- fontFamily={theme.fonts.inter_regular_400}
123
- size={theme.fontSizes.sm}
124
- />
125
- </Box>
126
- <Box
127
- borderStyled={{
128
- borderWidth: 1,
129
- borderColor: theme.colors.black[25],
130
- borderRadius: theme.borderWidths.thick_medium,
131
- }}
132
- flexStyle={{
133
- justifyContent: "center",
134
- alignItems: "center",
135
- }}
136
- >
137
- <Image
138
- source={{ uri: imagemUrl ?? "https://placehold.co/300x300" }}
139
- style={{
140
- width: "100%",
141
- height: 139,
142
- borderRadius: theme.borderWidths.thick_medium,
143
- }}
144
- resizeMode="cover"
145
- />
146
- </Box>
147
- </Box>
148
- </Box>
149
- );
150
- };
151
-
152
- ListSupplies.displayName = "ListSupplies";
153
- export default asBaseComponent(ListSupplies);
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React, { useEffect, useRef } from "react";
5
+ import { Animated, Image, View, Easing } from "react-native";
6
+
7
+ // components
8
+ import Box from "../../components/box";
9
+ import Typography from "../../components/typography";
10
+
11
+ // style
12
+ import { theme } from "../../styles/theme/theme";
13
+
14
+ // typings
15
+ import type { IListSupplies } from "./interface";
16
+ import { asBaseComponent } from "../../@types/as-base-component";
17
+
18
+ const ListSupplies: React.FC<IListSupplies> = ({
19
+ dataRegistro,
20
+ namePosto,
21
+ litragem,
22
+ valor,
23
+ imagemUrl,
24
+ corBarra,
25
+ }) => {
26
+ // 🔹 Valor de animação para fade + slide
27
+ const fadeAnim = useRef(new Animated.Value(0)).current;
28
+ const slideAnim = useRef(new Animated.Value(20)).current;
29
+
30
+ useEffect(() => {
31
+ // 🔹 Animação ao montar o componente
32
+ Animated.timing(fadeAnim, {
33
+ toValue: 1,
34
+ duration: 400,
35
+ easing: Easing.out(Easing.ease),
36
+ useNativeDriver: true,
37
+ }).start();
38
+
39
+ Animated.timing(slideAnim, {
40
+ toValue: 0,
41
+ duration: 400,
42
+ easing: Easing.out(Easing.ease),
43
+ useNativeDriver: true,
44
+ }).start();
45
+ }, [fadeAnim, slideAnim]);
46
+
47
+ return (
48
+ <Animated.View
49
+ style={{
50
+ opacity: fadeAnim,
51
+ transform: [{ translateY: slideAnim }],
52
+ }}
53
+ >
54
+ <Box
55
+ width={"100%"}
56
+ flexStyle={{ flexDirection: "row" }}
57
+ backgroundColor={theme.colors.neutral[25]}
58
+ borderStyled={{ borderRadius: theme.borderWidths.thick_medium }}
59
+ >
60
+ {/* faixa lateral */}
61
+ <View
62
+ style={{
63
+ width: 15,
64
+ backgroundColor: corBarra ?? theme.colors.blue[375],
65
+ borderTopLeftRadius: theme.borderWidths.thick_medium,
66
+ borderBottomLeftRadius: theme.borderWidths.thick_medium,
67
+ }}
68
+ />
69
+
70
+ <Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings["2xs"] }}>
71
+ {/* Nome do posto */}
72
+ <Box
73
+ marginStyle={{ marginBottom: theme.margins.fn }}
74
+ flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
75
+ >
76
+ <Typography
77
+ text={`${namePosto || "Não informado"}`}
78
+ color={theme.colors.black[25]}
79
+ fontFamily={theme.fonts.inter_medium_500}
80
+ size={theme.fontSizes.sm}
81
+ />
82
+ </Box>
83
+
84
+ {/* Litragem */}
85
+ <Box
86
+ marginStyle={{ marginBottom: theme.margins.fn }}
87
+ flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
88
+ >
89
+ <Typography
90
+ text="Litragem: "
91
+ color={theme.colors.black[25]}
92
+ fontFamily={theme.fonts.inter_medium_500}
93
+ size={theme.fontSizes.sm}
94
+ />
95
+ <Box flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}>
96
+ <Typography
97
+ text={`${litragem || "Não informado"}`}
98
+ color={theme.colors.black[25]}
99
+ fontFamily={theme.fonts.inter_regular_400}
100
+ size={theme.fontSizes.sm}
101
+ />
102
+ <Typography
103
+ text={` LT`}
104
+ color={theme.colors.red[400]}
105
+ fontFamily={theme.fonts.inter_regular_400}
106
+ size={theme.fontSizes.sm}
107
+ />
108
+ </Box>
109
+ </Box>
110
+
111
+ {/* Valor */}
112
+ <Box
113
+ marginStyle={{ marginBottom: theme.margins.fn }}
114
+ flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
115
+ >
116
+ <Typography
117
+ text="Valor: "
118
+ color={theme.colors.black[25]}
119
+ fontFamily={theme.fonts.inter_medium_500}
120
+ size={theme.fontSizes.sm}
121
+ />
122
+ <Typography
123
+ text={`R$ ${valor || "Não informado"}`}
124
+ color={theme.colors.gray[700]}
125
+ fontFamily={theme.fonts.inter_regular_400}
126
+ size={theme.fontSizes.sm}
127
+ />
128
+ </Box>
129
+
130
+ {/* Data */}
131
+ <Box
132
+ marginStyle={{ marginBottom: theme.margins.fn }}
133
+ flexStyle={{ flexDirection: "row", justifyContent: "flex-start" }}
134
+ >
135
+ <Typography
136
+ text={"Data: "}
137
+ color={theme.colors.black[25]}
138
+ fontFamily={theme.fonts.inter_medium_500}
139
+ size={theme.fontSizes.sm}
140
+ />
141
+ <Typography
142
+ text={`${dataRegistro || "Não informado"}`}
143
+ color={theme.colors.gray[700]}
144
+ fontFamily={theme.fonts.inter_regular_400}
145
+ size={theme.fontSizes.sm}
146
+ />
147
+ </Box>
148
+
149
+ {/* Imagem */}
150
+ <Box
151
+ borderStyled={{
152
+ borderWidth: 1,
153
+ borderColor: theme.colors.black[25],
154
+ borderRadius: theme.borderWidths.thick_medium,
155
+ }}
156
+ flexStyle={{
157
+ justifyContent: "center",
158
+ alignItems: "center",
159
+ }}
160
+ >
161
+ <Image
162
+ source={{ uri: imagemUrl ?? "https://placehold.co/300x300" }}
163
+ style={{
164
+ width: "100%",
165
+ height: 139,
166
+ borderRadius: theme.borderWidths.thick_medium,
167
+ }}
168
+ resizeMode="cover"
169
+ />
170
+ </Box>
171
+ </Box>
172
+ </Box>
173
+ </Animated.View>
174
+ );
175
+ };
176
+
177
+ ListSupplies.displayName = "ListSupplies";
178
+ export default asBaseComponent(ListSupplies);
@@ -4,18 +4,19 @@
4
4
  import React, { forwardRef, useState } from "react";
5
5
  import { View, Text, TextInput } from "react-native";
6
6
 
7
+ import Box from "../box";
8
+
7
9
  // typings
8
10
  import type { MaintenanceDescriptionInputProps } from "./interface";
9
11
  import { asBaseComponent } from "../../@types/as-base-component";
10
12
 
11
13
  // styles
12
14
  import { stylesInput } from "./styles";
13
- import Box from "../box";
14
15
 
15
16
  const MAX_LENGTH = 150;
16
17
 
17
18
  const MaintenanceDescriptionInput = forwardRef<any, MaintenanceDescriptionInputProps>(
18
- ({ label, onChangeText, error = null, ...props }, ref): React.ReactElement => {
19
+ ({ testID, label, onChangeText, error = null, ...props }, ref): React.ReactElement => {
19
20
  const [text, setText] = useState("");
20
21
 
21
22
  const handleChangeText = (value: string) => {
@@ -26,10 +27,13 @@ const MaintenanceDescriptionInput = forwardRef<any, MaintenanceDescriptionInputP
26
27
 
27
28
  return (
28
29
  <View>
29
- <Text style={stylesInput.label}>{label}</Text>
30
+ <Text testID={`${testID}-label`} style={stylesInput.label}>
31
+ {label}
32
+ </Text>
30
33
 
31
34
  <View style={stylesInput.inputWrapper}>
32
35
  <TextInput
36
+ testID={testID}
33
37
  ref={ref}
34
38
  multiline
35
39
  style={stylesInput.input}
@@ -46,7 +50,10 @@ const MaintenanceDescriptionInput = forwardRef<any, MaintenanceDescriptionInputP
46
50
  marginStyle={{ marginBottom: 16 }}
47
51
  >
48
52
  {error && <Text style={stylesInput.errorText}>{error}</Text>}
49
- <Text style={stylesInput.charCount}>{`${text.length}/${MAX_LENGTH}`}</Text>
53
+ <Text
54
+ testID={`${testID}-counter`}
55
+ style={stylesInput.charCount}
56
+ >{`${text.length}/${MAX_LENGTH}`}</Text>
50
57
  </Box>
51
58
  </View>
52
59
  );