react-native-exp-fig 0.1.26 → 0.1.27

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 (191) hide show
  1. package/lib/commonjs/components/input-text-counter/index.js +66 -0
  2. package/lib/commonjs/components/input-text-counter/index.js.map +1 -0
  3. package/lib/commonjs/components/input-text-counter/interface.d.js.map +1 -0
  4. package/lib/commonjs/components/input-text-counter/styles.js +42 -0
  5. package/lib/commonjs/components/input-text-counter/styles.js.map +1 -0
  6. package/lib/commonjs/components/modal-create-activitie/index.js +202 -0
  7. package/lib/commonjs/components/modal-create-activitie/index.js.map +1 -0
  8. package/lib/commonjs/components/modal-create-activitie/interface.js +2 -0
  9. package/lib/commonjs/components/modal-create-activitie/interface.js.map +1 -0
  10. package/lib/commonjs/components/modal-create-activitie/styles.js +42 -0
  11. package/lib/commonjs/components/modal-create-activitie/styles.js.map +1 -0
  12. package/lib/commonjs/components/modal-journey-rectification/index.js +202 -0
  13. package/lib/commonjs/components/modal-journey-rectification/index.js.map +1 -0
  14. package/lib/commonjs/components/modal-journey-rectification/interface.d.js +2 -0
  15. package/lib/commonjs/components/modal-journey-rectification/interface.d.js.map +1 -0
  16. package/lib/commonjs/components/modal-journey-rectification/styles.js +42 -0
  17. package/lib/commonjs/components/modal-journey-rectification/styles.js.map +1 -0
  18. package/lib/commonjs/components/{modal-activities → modals/modal-activities}/data-activities/index.js +2 -2
  19. package/lib/commonjs/components/modals/modal-activities/data-activities/index.js.map +1 -0
  20. package/lib/commonjs/components/{modal-activities → modals/modal-activities}/index.js +8 -8
  21. package/lib/commonjs/components/modals/modal-activities/index.js.map +1 -0
  22. package/lib/commonjs/components/modals/modal-activities/interface.d.js +6 -0
  23. package/lib/commonjs/components/modals/modal-activities/interface.d.js.map +1 -0
  24. package/lib/commonjs/components/modals/modal-activity-reason/index.js +161 -0
  25. package/lib/commonjs/components/modals/modal-activity-reason/index.js.map +1 -0
  26. package/lib/commonjs/components/modals/modal-activity-reason/interface.d.js +2 -0
  27. package/lib/commonjs/components/modals/modal-activity-reason/interface.d.js.map +1 -0
  28. package/lib/commonjs/components/{modal-change-activity → modals/modal-change-activity}/index.js +7 -7
  29. package/lib/commonjs/components/modals/modal-change-activity/index.js.map +1 -0
  30. package/lib/commonjs/components/selects/select-date-and-hours/index.js +95 -0
  31. package/lib/commonjs/components/selects/select-date-and-hours/index.js.map +1 -0
  32. package/lib/commonjs/components/selects/select-date-and-hours/interface.js +6 -0
  33. package/lib/commonjs/components/selects/select-date-and-hours/interface.js.map +1 -0
  34. package/lib/commonjs/components/selects/select-date-and-hours/styles.js +33 -0
  35. package/lib/commonjs/components/selects/select-date-and-hours/styles.js.map +1 -0
  36. package/lib/commonjs/components/selects/select-option/index.js +41 -39
  37. package/lib/commonjs/components/selects/select-option/index.js.map +1 -1
  38. package/lib/commonjs/components/step-indicator/index.js +7 -7
  39. package/lib/commonjs/components/step-indicator/index.js.map +1 -1
  40. package/lib/commonjs/index.js +32 -4
  41. package/lib/commonjs/index.js.map +1 -1
  42. package/lib/commonjs/stories/input-text-counter/input-text-counter.stories.js +259 -0
  43. package/lib/commonjs/stories/input-text-counter/input-text-counter.stories.js.map +1 -0
  44. package/lib/commonjs/stories/modal-activities/modal-activities.stories.js +1 -1
  45. package/lib/commonjs/stories/modal-activities/modal-activities.stories.js.map +1 -1
  46. package/lib/commonjs/stories/modal-activity-reason/modal-activity-reason.stories.js +198 -0
  47. package/lib/commonjs/stories/modal-activity-reason/modal-activity-reason.stories.js.map +1 -0
  48. package/lib/commonjs/stories/modal-change-activity/modal-change-activity.stories.js +3 -3
  49. package/lib/commonjs/stories/modal-change-activity/modal-change-activity.stories.js.map +1 -1
  50. package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js +86 -0
  51. package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -0
  52. package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js +172 -0
  53. package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -0
  54. package/lib/commonjs/stories/select-option/select-option.stories.js +3 -2
  55. package/lib/commonjs/stories/select-option/select-option.stories.js.map +1 -1
  56. package/lib/commonjs/styles/theme/theme.js +18 -2
  57. package/lib/commonjs/styles/theme/theme.js.map +1 -1
  58. package/lib/commonjs/utils/options-activity/index.js +27 -0
  59. package/lib/commonjs/utils/options-activity/index.js.map +1 -0
  60. package/lib/commonjs/utils/text-limit/index.js +37 -0
  61. package/lib/commonjs/utils/text-limit/index.js.map +1 -0
  62. package/lib/module/components/input-text-counter/index.js +63 -0
  63. package/lib/module/components/input-text-counter/index.js.map +1 -0
  64. package/lib/module/components/input-text-counter/interface.d.js.map +1 -0
  65. package/lib/module/components/input-text-counter/styles.js +37 -0
  66. package/lib/module/components/input-text-counter/styles.js.map +1 -0
  67. package/lib/module/components/modal-create-activitie/index.js +192 -0
  68. package/lib/module/components/modal-create-activitie/index.js.map +1 -0
  69. package/lib/module/components/modal-create-activitie/interface.js +2 -0
  70. package/lib/module/components/modal-create-activitie/interface.js.map +1 -0
  71. package/lib/module/components/modal-create-activitie/styles.js +37 -0
  72. package/lib/module/components/modal-create-activitie/styles.js.map +1 -0
  73. package/lib/module/components/modal-journey-rectification/index.js +192 -0
  74. package/lib/module/components/modal-journey-rectification/index.js.map +1 -0
  75. package/lib/module/components/modal-journey-rectification/interface.d.js +2 -0
  76. package/lib/module/components/modal-journey-rectification/interface.d.js.map +1 -0
  77. package/lib/module/components/modal-journey-rectification/styles.js +37 -0
  78. package/lib/module/components/modal-journey-rectification/styles.js.map +1 -0
  79. package/lib/module/components/{modal-activities → modals/modal-activities}/data-activities/index.js +2 -2
  80. package/lib/module/components/modals/modal-activities/data-activities/index.js.map +1 -0
  81. package/lib/module/components/{modal-activities → modals/modal-activities}/index.js +8 -8
  82. package/lib/module/components/modals/modal-activities/index.js.map +1 -0
  83. package/lib/module/components/modals/modal-activities/interface.d.js +2 -0
  84. package/lib/module/components/modals/modal-activities/interface.d.js.map +1 -0
  85. package/lib/module/components/modals/modal-activity-reason/index.js +151 -0
  86. package/lib/module/components/modals/modal-activity-reason/index.js.map +1 -0
  87. package/lib/module/components/modals/modal-activity-reason/interface.d.js +2 -0
  88. package/lib/module/components/modals/modal-activity-reason/interface.d.js.map +1 -0
  89. package/lib/module/components/{modal-change-activity → modals/modal-change-activity}/index.js +6 -6
  90. package/lib/module/components/modals/modal-change-activity/index.js.map +1 -0
  91. package/lib/module/components/selects/select-date-and-hours/index.js +86 -0
  92. package/lib/module/components/selects/select-date-and-hours/index.js.map +1 -0
  93. package/lib/module/components/selects/select-date-and-hours/interface.js +2 -0
  94. package/lib/module/components/selects/select-date-and-hours/interface.js.map +1 -0
  95. package/lib/module/components/selects/select-date-and-hours/styles.js +28 -0
  96. package/lib/module/components/selects/select-date-and-hours/styles.js.map +1 -0
  97. package/lib/module/components/selects/select-option/index.js +41 -42
  98. package/lib/module/components/selects/select-option/index.js.map +1 -1
  99. package/lib/module/components/step-indicator/index.js +7 -7
  100. package/lib/module/components/step-indicator/index.js.map +1 -1
  101. package/lib/module/index.js +9 -5
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/stories/input-text-counter/input-text-counter.stories.js +253 -0
  104. package/lib/module/stories/input-text-counter/input-text-counter.stories.js.map +1 -0
  105. package/lib/module/stories/modal-activities/modal-activities.stories.js +1 -1
  106. package/lib/module/stories/modal-activities/modal-activities.stories.js.map +1 -1
  107. package/lib/module/stories/modal-activity-reason/modal-activity-reason.stories.js +193 -0
  108. package/lib/module/stories/modal-activity-reason/modal-activity-reason.stories.js.map +1 -0
  109. package/lib/module/stories/modal-change-activity/modal-change-activity.stories.js +3 -3
  110. package/lib/module/stories/modal-change-activity/modal-change-activity.stories.js.map +1 -1
  111. package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js +78 -0
  112. package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -0
  113. package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js +168 -0
  114. package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -0
  115. package/lib/module/stories/select-option/select-option.stories.js +1 -1
  116. package/lib/module/stories/select-option/select-option.stories.js.map +1 -1
  117. package/lib/module/styles/theme/theme.js +18 -2
  118. package/lib/module/styles/theme/theme.js.map +1 -1
  119. package/lib/module/utils/options-activity/index.js +22 -0
  120. package/lib/module/utils/options-activity/index.js.map +1 -0
  121. package/lib/module/utils/text-limit/index.js +30 -0
  122. package/lib/module/utils/text-limit/index.js.map +1 -0
  123. package/lib/typescript/src/components/input-text-counter/index.d.ts +33 -0
  124. package/lib/typescript/src/components/input-text-counter/styles.d.ts +34 -0
  125. package/lib/typescript/src/components/modal-create-activitie/index.d.ts +7 -0
  126. package/lib/typescript/src/components/modal-create-activitie/interface.d.ts +18 -0
  127. package/lib/typescript/src/components/modal-create-activitie/styles.d.ts +32 -0
  128. package/lib/typescript/src/components/modal-journey-rectification/index.d.ts +7 -0
  129. package/lib/typescript/src/components/modal-journey-rectification/styles.d.ts +32 -0
  130. package/lib/typescript/src/components/modals/modal-activity-reason/index.d.ts +7 -0
  131. package/lib/typescript/src/components/selects/select-date-and-hours/index.d.ts +12 -0
  132. package/lib/typescript/src/components/selects/select-date-and-hours/interface.d.ts +21 -0
  133. package/lib/typescript/src/components/selects/select-date-and-hours/styles.d.ts +24 -0
  134. package/lib/typescript/src/components/selects/select-option/index.d.ts +3 -6
  135. package/lib/typescript/src/index.d.ts +7 -3
  136. package/lib/typescript/src/stories/input-text-counter/input-text-counter.stories.d.ts +17 -0
  137. package/lib/typescript/src/stories/modal-activities/modal-activities.stories.d.ts +1 -1
  138. package/lib/typescript/src/stories/modal-activity-reason/modal-activity-reason.stories.d.ts +15 -0
  139. package/lib/typescript/src/stories/modal-change-activity/modal-change-activity.stories.d.ts +1 -1
  140. package/lib/typescript/src/stories/modal-create-activitie/modal-create-activitie.stories.d.ts +12 -0
  141. package/lib/typescript/src/stories/modal-journey-rectification/modal-journey-rectification.stories.d.ts +34 -0
  142. package/lib/typescript/src/stories/select-option/select-option.stories.d.ts +1 -1
  143. package/lib/typescript/src/styles/global/theme-provider.d.ts +16 -0
  144. package/lib/typescript/src/styles/theme/theme.d.ts +16 -0
  145. package/lib/typescript/src/utils/options-activity/index.d.ts +20 -0
  146. package/lib/typescript/src/utils/text-limit/index.d.ts +13 -0
  147. package/package.json +1 -1
  148. package/src/components/input-text-counter/index.tsx +64 -0
  149. package/src/components/input-text-counter/interface.d.ts +41 -0
  150. package/src/components/input-text-counter/styles.ts +38 -0
  151. package/src/components/modal-create-activitie/index.tsx +211 -0
  152. package/src/components/modal-create-activitie/interface.ts +22 -0
  153. package/src/components/modal-create-activitie/styles.ts +24 -0
  154. package/src/components/modal-journey-rectification/index.tsx +211 -0
  155. package/src/components/modal-journey-rectification/interface.d.ts +22 -0
  156. package/src/components/modal-journey-rectification/styles.ts +24 -0
  157. package/src/components/{modal-activities → modals/modal-activities}/data-activities/index.ts +65 -65
  158. package/src/components/{modal-activities → modals/modal-activities}/index.tsx +137 -137
  159. package/src/components/{modal-activities → modals/modal-activities}/interface.d.ts +32 -32
  160. package/src/components/modals/modal-activity-reason/index.tsx +162 -0
  161. package/src/components/modals/modal-activity-reason/interface.d.ts +10 -0
  162. package/src/components/{modal-change-activity → modals/modal-change-activity}/index.tsx +6 -6
  163. package/src/components/selects/select-date-and-hours/index.tsx +97 -0
  164. package/src/components/selects/select-date-and-hours/interface.ts +31 -0
  165. package/src/components/selects/select-date-and-hours/styles.ts +24 -0
  166. package/src/components/selects/select-option/index.tsx +50 -41
  167. package/src/components/step-indicator/index.tsx +235 -235
  168. package/src/index.ts +49 -45
  169. package/src/stories/input-text-counter/input-text-counter.stories.tsx +232 -0
  170. package/src/stories/modal-activities/modal-activities.stories.tsx +64 -64
  171. package/src/stories/modal-activity-reason/modal-activity-reason.stories.tsx +192 -0
  172. package/src/stories/modal-change-activity/modal-change-activity.stories.tsx +49 -49
  173. package/src/stories/modal-create-activitie/modal-create-activitie.stories.tsx +82 -0
  174. package/src/stories/modal-journey-rectification/modal-journey-rectification.stories.tsx +161 -0
  175. package/src/stories/select-option/select-option.stories.tsx +1 -1
  176. package/src/styles/theme/theme.ts +17 -0
  177. package/src/utils/options-activity/index.ts +14 -0
  178. package/src/utils/text-limit/index.ts +28 -0
  179. package/lib/commonjs/components/modal-activities/data-activities/index.js.map +0 -1
  180. package/lib/commonjs/components/modal-activities/index.js.map +0 -1
  181. package/lib/commonjs/components/modal-activities/interface.d.js.map +0 -1
  182. package/lib/commonjs/components/modal-change-activity/index.js.map +0 -1
  183. package/lib/module/components/modal-activities/data-activities/index.js.map +0 -1
  184. package/lib/module/components/modal-activities/index.js.map +0 -1
  185. package/lib/module/components/modal-activities/interface.d.js.map +0 -1
  186. package/lib/module/components/modal-change-activity/index.js.map +0 -1
  187. /package/lib/commonjs/components/{modal-activities → input-text-counter}/interface.d.js +0 -0
  188. /package/lib/module/components/{modal-activities → input-text-counter}/interface.d.js +0 -0
  189. /package/lib/typescript/src/components/{modal-activities → modals/modal-activities}/data-activities/index.d.ts +0 -0
  190. /package/lib/typescript/src/components/{modal-activities → modals/modal-activities}/index.d.ts +0 -0
  191. /package/lib/typescript/src/components/{modal-change-activity → modals/modal-change-activity}/index.d.ts +0 -0
@@ -1,137 +1,137 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React from "react";
5
- import { Modal, TouchableOpacity, FlatList } from "react-native";
6
-
7
- // components
8
-
9
- import Box from "../box";
10
-
11
- // commons / icons
12
- import { Icons } from "../../common/icons-svg";
13
- import { getIconModalActivities } from "../../common/icons-svg/modal-activities";
14
-
15
- // styles
16
- import { theme } from "../../styles/theme/theme";
17
- import { Typography } from "../typography";
18
- import { Button } from "../button";
19
-
20
- //typing
21
- import { IModalActivities, IActivity } from "./interface";
22
-
23
- // atividades
24
- import { activities } from "./data-activities";
25
-
26
- export const ModalActivities: React.FC<IModalActivities> = ({
27
- onClose,
28
- handleActivity,
29
- activityType,
30
- isLoading,
31
- style,
32
- }) => {
33
- return (
34
- <Modal animationType="fade" transparent={true} onRequestClose={onClose}>
35
- <Box
36
- backgroundColor={"rgba(0, 0, 0, 0.7)"}
37
- flexStyle={{ flex: 1, justifyContent: "center", alignItems: "center" }}
38
- >
39
- <Box
40
- height={310}
41
- width={"92%"}
42
- backgroundColor={theme.colors.neutral[25]}
43
- borderStyled={{
44
- borderColor: theme.colors.blue[500],
45
- borderWidth: theme.borderWidths.thick,
46
- borderRadius: theme.borderWidths.thick_medium,
47
- }}
48
- paddingStyle={{
49
- padding: theme.paddings.md,
50
- }}
51
- style={{ position: "relative" }}
52
- >
53
- <Box
54
- width={"100%"}
55
- flexStyle={{
56
- flexDirection: "row",
57
- justifyContent: "space-between",
58
- alignItems: "center",
59
- }}
60
- >
61
- <Typography
62
- text="Atividades"
63
- size={theme.fontSizes.md}
64
- color={theme.colors.blue[500]}
65
- fontFamily={theme.fonts.inter_bold_700}
66
- lineHeight={theme.fontSizes.xl}
67
- />
68
-
69
- <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>
70
- <Icons icon="CLOSED" color={theme.colors.blue[500]} />
71
- </TouchableOpacity>
72
- </Box>
73
- {/* as atividades */}
74
- <Box marginStyle={{ marginTop: theme.margins["2xl"] }}>
75
- <FlatList
76
- data={activities[activityType]}
77
- numColumns={3}
78
- keyExtractor={(item) => item.id.toString()}
79
- scrollEnabled={false}
80
- renderItem={({ item }) => (
81
- <TouchableOpacity
82
- style={{
83
- alignItems: "center",
84
- width: 110,
85
- marginBottom: theme.margins["2xl"], // espaço entre as linhas
86
- }}
87
- onPress={() => handleActivity(item as IActivity)}
88
- >
89
- {getIconModalActivities(item.referencia)}
90
-
91
- <Typography
92
- text={item.descricao}
93
- size={theme.fontSizes.xs}
94
- color={theme.colors.blue[500]}
95
- lineHeight={theme.fontSizes.md}
96
- fontFamily={theme.fonts.inter_medium_500}
97
- fontWeight="500"
98
- align="center"
99
- marginTop={5}
100
- />
101
- </TouchableOpacity>
102
- )}
103
- />
104
- </Box>
105
-
106
- <Button
107
- title={"CANCELAR ATIVIDADE"}
108
- width="100%"
109
- height={40}
110
- activeOpacity={0.7}
111
- onPress={onClose}
112
- backgroundColor={theme.colors.blue[500]}
113
- buttonTextStyle={{
114
- color: theme.colors.neutral[25],
115
- fontFamily: theme.fonts.inter_medium_500,
116
- fontSize: theme.fontSizes.md,
117
- fontWeight: "500",
118
- }}
119
- flexStyle={{
120
- flexDirection: "row",
121
- alignItems: "center",
122
- justifyContent: "center",
123
- }}
124
- borderStyled={{
125
- borderWidth: theme.borderWidths.thin,
126
- borderColor: theme.colors.blue[500],
127
- borderRadius: theme.borderWidths.thick_medium,
128
- }}
129
- marginStyle={{ marginLeft: theme.margins.md }}
130
- isLoading={isLoading ?? false}
131
- style={[style, { position: "absolute", bottom: 10, left: 0 }]}
132
- />
133
- </Box>
134
- </Box>
135
- </Modal>
136
- );
137
- };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React from "react";
5
+ import { Modal, TouchableOpacity, FlatList } from "react-native";
6
+
7
+ // components
8
+
9
+ import Box from "../../box";
10
+
11
+ // commons / icons
12
+ import { Icons } from "../../../common/icons-svg";
13
+ import { getIconModalActivities } from "../../../common/icons-svg/modal-activities";
14
+
15
+ // styles
16
+ import { theme } from "../../../styles/theme/theme";
17
+ import { Typography } from "../../typography";
18
+ import { Button } from "../../button";
19
+
20
+ //typing
21
+ import { IModalActivities, IActivity } from "./interface";
22
+
23
+ // atividades
24
+ import { activities } from "./data-activities";
25
+
26
+ export const ModalActivities: React.FC<IModalActivities> = ({
27
+ onClose,
28
+ handleActivity,
29
+ activityType,
30
+ isLoading,
31
+ style,
32
+ }) => {
33
+ return (
34
+ <Modal animationType="fade" transparent={true} onRequestClose={onClose}>
35
+ <Box
36
+ backgroundColor={"rgba(0, 0, 0, 0.7)"}
37
+ flexStyle={{ flex: 1, justifyContent: "center", alignItems: "center" }}
38
+ >
39
+ <Box
40
+ height={310}
41
+ width={"92%"}
42
+ backgroundColor={theme.colors.neutral[25]}
43
+ borderStyled={{
44
+ borderColor: theme.colors.blue[500],
45
+ borderWidth: theme.borderWidths.thick,
46
+ borderRadius: theme.borderWidths.thick_medium,
47
+ }}
48
+ paddingStyle={{
49
+ padding: theme.paddings.md,
50
+ }}
51
+ style={{ position: "relative" }}
52
+ >
53
+ <Box
54
+ width={"100%"}
55
+ flexStyle={{
56
+ flexDirection: "row",
57
+ justifyContent: "space-between",
58
+ alignItems: "center",
59
+ }}
60
+ >
61
+ <Typography
62
+ text="Atividades"
63
+ size={theme.fontSizes.md}
64
+ color={theme.colors.blue[500]}
65
+ fontFamily={theme.fonts.inter_bold_700}
66
+ lineHeight={theme.fontSizes.xl}
67
+ />
68
+
69
+ <TouchableOpacity activeOpacity={0.7} onPress={onClose} style={{}}>
70
+ <Icons icon="CLOSED" color={theme.colors.blue[500]} />
71
+ </TouchableOpacity>
72
+ </Box>
73
+ {/* as atividades */}
74
+ <Box marginStyle={{ marginTop: theme.margins["2xl"] }}>
75
+ <FlatList
76
+ data={activities[activityType]}
77
+ numColumns={3}
78
+ keyExtractor={(item) => item.id.toString()}
79
+ scrollEnabled={false}
80
+ renderItem={({ item }) => (
81
+ <TouchableOpacity
82
+ style={{
83
+ alignItems: "center",
84
+ width: 110,
85
+ marginBottom: theme.margins["2xl"], // espaço entre as linhas
86
+ }}
87
+ onPress={() => handleActivity(item as IActivity)}
88
+ >
89
+ {getIconModalActivities(item.referencia)}
90
+
91
+ <Typography
92
+ text={item.descricao}
93
+ size={theme.fontSizes.xs}
94
+ color={theme.colors.blue[500]}
95
+ lineHeight={theme.fontSizes.md}
96
+ fontFamily={theme.fonts.inter_medium_500}
97
+ fontWeight="500"
98
+ align="center"
99
+ marginTop={5}
100
+ />
101
+ </TouchableOpacity>
102
+ )}
103
+ />
104
+ </Box>
105
+
106
+ <Button
107
+ title={"CANCELAR ATIVIDADE"}
108
+ width="100%"
109
+ height={40}
110
+ activeOpacity={0.7}
111
+ onPress={onClose}
112
+ backgroundColor={theme.colors.blue[500]}
113
+ buttonTextStyle={{
114
+ color: theme.colors.neutral[25],
115
+ fontFamily: theme.fonts.inter_medium_500,
116
+ fontSize: theme.fontSizes.md,
117
+ fontWeight: "500",
118
+ }}
119
+ flexStyle={{
120
+ flexDirection: "row",
121
+ alignItems: "center",
122
+ justifyContent: "center",
123
+ }}
124
+ borderStyled={{
125
+ borderWidth: theme.borderWidths.thin,
126
+ borderColor: theme.colors.blue[500],
127
+ borderRadius: theme.borderWidths.thick_medium,
128
+ }}
129
+ marginStyle={{ marginLeft: theme.margins.md }}
130
+ isLoading={isLoading ?? false}
131
+ style={[style, { position: "absolute", bottom: 10, left: 0 }]}
132
+ />
133
+ </Box>
134
+ </Box>
135
+ </Modal>
136
+ );
137
+ };
@@ -1,32 +1,32 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import { ModalProps } from "react-native";
5
-
6
- // typing
7
- import { IGlobalCss } from "../../styles/global/interface";
8
-
9
- interface IActivity {
10
- id: number;
11
- referencia: string;
12
- cor_hex: string;
13
- descricao: string;
14
- tipo: "trabalho" | "descanso";
15
- }
16
-
17
- interface IModalActivities extends ModalProps, IGlobalCss {
18
- /** função que fecha modal */
19
- onClose: () => void;
20
-
21
- /** tipo de atividades */
22
- activityType: IActivity["tipo"];
23
-
24
- /** função que manda atividade selecionada */
25
- // eslint-disable-next-line no-unused-vars
26
- handleActivity: (activity: IActivity) => void;
27
- }
28
-
29
- /**
30
- * EXPORTS
31
- */
32
- export { IModalActivities, IActivity };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import { ModalProps } from "react-native";
5
+
6
+ // typing
7
+ import { IGlobalCss } from "../../../styles/global/interface";
8
+
9
+ interface IActivity {
10
+ id: number;
11
+ referencia: string;
12
+ cor_hex: string;
13
+ descricao: string;
14
+ tipo: "trabalho" | "descanso";
15
+ }
16
+
17
+ interface IModalActivities extends ModalProps, IGlobalCss {
18
+ /** função que fecha modal */
19
+ onClose: () => void;
20
+
21
+ /** tipo de atividades */
22
+ activityType: IActivity["tipo"];
23
+
24
+ /** função que manda atividade selecionada */
25
+ // eslint-disable-next-line no-unused-vars
26
+ handleActivity: (activity: IActivity) => void;
27
+ }
28
+
29
+ /**
30
+ * EXPORTS
31
+ */
32
+ export { IModalActivities, IActivity };
@@ -0,0 +1,162 @@
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React, { useState } from "react";
5
+ import { Modal, View } from "react-native";
6
+
7
+ // components
8
+ import Box from "../../box";
9
+ import { Typography } from "../../typography";
10
+ import { Button } from "../../button";
11
+
12
+ import InputTextCounter from "../../input-text-counter";
13
+
14
+ // commons / svg
15
+ import { Icons } from "../../../common/icons-svg";
16
+
17
+ // typings
18
+ import type { IModalActivityReasonProps } from "./interface";
19
+
20
+ // styles
21
+ import { theme } from "../../../styles/theme/theme";
22
+
23
+ const ModalActivityReason: React.FC<IModalActivityReasonProps> = ({
24
+ visible,
25
+ onClose,
26
+ modalConfirm,
27
+ textTitle,
28
+ testID,
29
+ }) => {
30
+ const [isLoading] = useState(false);
31
+
32
+ return (
33
+ <Modal testID={testID} animationType="fade" transparent visible={visible}>
34
+ <View
35
+ style={{
36
+ flex: 1,
37
+ justifyContent: "center",
38
+ alignItems: "center",
39
+ backgroundColor: "rgba(0,0,0,0.6)",
40
+ }}
41
+ >
42
+ <Box
43
+ width={"90%"}
44
+ backgroundColor={theme.colors.orange[500]}
45
+ borderStyled={{
46
+ borderRadius: theme.borderWidths.thick_medium,
47
+ }}
48
+ paddingStyle={{
49
+ paddingLeft: theme.paddings["2xs"],
50
+ paddingRight: theme.paddings["2xs"],
51
+ paddingTop: theme.paddings.sm,
52
+ paddingBottom: theme.paddings.sm,
53
+ }}
54
+ >
55
+ <Box
56
+ marginStyle={{ marginBottom: 10, marginLeft: 4 }}
57
+ flexStyle={{ flexDirection: "row", alignItems: "center" }}
58
+ >
59
+ <Icons
60
+ icon="EXCLAMATION_TRIANGLE"
61
+ color={theme.colors.orange[500]}
62
+ background={theme.colors.neutral[300]}
63
+ size={22}
64
+ />
65
+ <Typography
66
+ text={`${textTitle ?? "Motivo da exclusão"}`}
67
+ color={theme.colors.neutral[25]}
68
+ marginLeft={theme.margins["2xs"]}
69
+ fontFamily={theme.fonts.inter_bold_700}
70
+ size={theme.fontSizes.md}
71
+ />
72
+ </Box>
73
+
74
+ <Box
75
+ backgroundColor={theme.colors.neutral[300]}
76
+ paddingStyle={{
77
+ padding: theme.paddings.xs,
78
+ }}
79
+ borderStyled={{
80
+ borderRadius: theme.borderWidths.thick_medium,
81
+ }}
82
+ >
83
+ <Box width="100%">
84
+ <InputTextCounter
85
+ label={`${textTitle || "Motivo da exclusão"}`}
86
+ placeholderTextColor="#9B9B9B"
87
+ placeholder="Motivo da exclusão"
88
+ />
89
+ </Box>
90
+ <Box
91
+ marginStyle={{ marginTop: 4 }}
92
+ flexStyle={{
93
+ flexDirection: "row",
94
+ justifyContent: "space-between",
95
+ }}
96
+ >
97
+ <Button
98
+ title="CANCELAR"
99
+ onPress={onClose}
100
+ width={"48%"}
101
+ height={40}
102
+ isLoading={isLoading}
103
+ disabled={isLoading}
104
+ backgroundColor={theme.colors.neutral[300]}
105
+ buttonTextStyle={{
106
+ color: theme.colors.blue[100],
107
+ fontFamily: "Inter-Medium",
108
+ fontSize: theme.fontSizes.xs,
109
+ fontWeight: "500",
110
+ }}
111
+ flexStyle={{
112
+ flexDirection: "row",
113
+ alignItems: "center",
114
+ justifyContent: "center",
115
+ textAlign: "center",
116
+ }}
117
+ borderStyled={{
118
+ borderWidth: theme.borderWidths.thin,
119
+ borderColor: theme.colors.blue[100],
120
+ borderRadius: theme.borderWidths.thick_medium,
121
+ }}
122
+ />
123
+ <Button
124
+ title="CONFIRMAR"
125
+ onPress={() => {
126
+ modalConfirm(true);
127
+ onClose();
128
+ }}
129
+ width={"48%"}
130
+ height={40}
131
+ isLoading={isLoading}
132
+ disabled={isLoading}
133
+ backgroundColor={theme.colors.blue[500]}
134
+ buttonTextStyle={{
135
+ color: theme.colors.neutral[25],
136
+ fontFamily: "Inter-Medium",
137
+ fontSize: theme.fontSizes.xs,
138
+ fontWeight: "500",
139
+ }}
140
+ flexStyle={{
141
+ flexDirection: "row",
142
+ alignItems: "center",
143
+ justifyContent: "center",
144
+ textAlign: "center",
145
+ }}
146
+ borderStyled={{
147
+ borderWidth: theme.borderWidths.thin,
148
+ borderColor: theme.colors.blue[100],
149
+ borderRadius: theme.borderWidths.thick_medium,
150
+ }}
151
+ />
152
+ </Box>
153
+ </Box>
154
+ </Box>
155
+ </View>
156
+ </Modal>
157
+ );
158
+ };
159
+
160
+ ModalActivityReason.displayName = "ModalActivityReason";
161
+
162
+ export default ModalActivityReason;
@@ -0,0 +1,10 @@
1
+ /* eslint-disable no-unused-vars */
2
+ interface IModalActivityReasonProps {
3
+ visible: boolean;
4
+ onClose: () => void;
5
+ modalConfirm: (value: true) => void;
6
+ textTitle?: string;
7
+ testID?: string;
8
+ }
9
+
10
+ export type { IModalActivityReasonProps };
@@ -7,16 +7,16 @@ import React from "react";
7
7
  import { Modal, View } from "react-native";
8
8
 
9
9
  // componentes internos
10
- import Box from "../box";
11
- import { Typography } from "../typography";
12
- import { SelectOption } from "../selects/select-option";
13
- import { Button } from "../button";
10
+ import Box from "../../box";
11
+ import { Typography } from "../../typography";
12
+ import { Button } from "../../button";
13
+ import SelectOption from "../../selects/select-option";
14
14
 
15
15
  // styles / theme
16
- import { theme } from "../../styles/theme/theme";
16
+ import { theme } from "../../../styles/theme/theme";
17
17
 
18
18
  // assets / icons
19
- import { Icons } from "../../common/icons-svg";
19
+ import { Icons } from "../../../common/icons-svg";
20
20
 
21
21
  /**
22
22
  * TYPES
@@ -0,0 +1,97 @@
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React, { forwardRef, useState } from "react";
5
+
6
+ import { View, TouchableOpacity } from "react-native";
7
+ import DateTimePicker from "@react-native-community/datetimepicker";
8
+
9
+ // seus componentes
10
+ import Box from "../../box";
11
+ import { Typography } from "../../typography";
12
+
13
+ // commons / svg
14
+ import { Icons } from "../../../common/icons-svg";
15
+
16
+ // typings
17
+ import type { IActivityFieldsProps } from "./interface";
18
+ import { asBaseComponent } from "../../../@types/as-base-component";
19
+
20
+ // styles
21
+ import { theme } from "../../../styles/theme/theme";
22
+ import { styles } from "./styles";
23
+ import { formatDate, formHoursMinute } from "../../../utils/format-data";
24
+
25
+ const ActivityFields = forwardRef<any, IActivityFieldsProps<any>>(
26
+ ({ value, icon, onPressConfirm, disabled = false }, ref): React.ReactElement => {
27
+ const [modalVisible, setModalVisible] = useState(false);
28
+ const [pickerDate, setPickerDate] = useState<Date>(new Date());
29
+
30
+ const isCalendar = (icon ?? "CALENDAR") === "CALENDAR";
31
+
32
+ return (
33
+ <>
34
+ <TouchableOpacity
35
+ ref={ref}
36
+ activeOpacity={0.7}
37
+ style={[
38
+ styles.field,
39
+ {
40
+ borderColor: theme.colors.gray[700],
41
+ backgroundColor: theme.colors.neutral[300],
42
+ opacity: disabled ? 0.7 : 1,
43
+ },
44
+ ]}
45
+ onPress={() => setModalVisible(true)}
46
+ disabled={disabled}
47
+ >
48
+ <View style={styles.row}>
49
+ <Box
50
+ width={"10%"}
51
+ height={45}
52
+ flexStyle={{ alignItems: "center", justifyContent: "center" }}
53
+ >
54
+ <Icons icon={icon ? icon : "CALENDAR"} color={theme.colors.black[100]} size={18} />
55
+ </Box>
56
+
57
+ <Box
58
+ width={"90%"}
59
+ height={45}
60
+ flexStyle={{ alignItems: "center", justifyContent: "center" }}
61
+ >
62
+ <Typography
63
+ text={String(value)}
64
+ color={theme.colors.blue[500]}
65
+ fontFamily={theme.fonts.inter_medium_500}
66
+ size={theme.fontSizes.md}
67
+ marginRight={44}
68
+ />
69
+ </Box>
70
+ </View>
71
+ </TouchableOpacity>
72
+
73
+ {modalVisible && (
74
+ <DateTimePicker
75
+ value={pickerDate}
76
+ mode={isCalendar ? "date" : "time"}
77
+ is24Hour
78
+ onChange={(event: any, date?: Date) => {
79
+ if (event?.type === "set" && date) {
80
+ setPickerDate(date);
81
+ const seconds = date.getHours() * 3600 + date.getMinutes() * 60;
82
+ const nextValue = isCalendar ? formatDate(date) : formHoursMinute(String(seconds));
83
+ // @ts-ignore genérico aceita string
84
+ onPressConfirm(nextValue);
85
+ }
86
+ setModalVisible(false);
87
+ }}
88
+ />
89
+ )}
90
+ </>
91
+ );
92
+ }
93
+ );
94
+
95
+ ActivityFields.displayName = "ActivityFields";
96
+
97
+ export default asBaseComponent(ActivityFields);
@@ -0,0 +1,31 @@
1
+ /* eslint-disable no-unused-vars */
2
+ /**
3
+ * IMPORTS
4
+ */
5
+
6
+ import type { TouchableOpacityProps } from "react-native";
7
+
8
+ // commons / svg
9
+ import type { SVG_NAME } from "../../../common/icons-svg/constants";
10
+
11
+ type IActivityFieldsProps<T> = TouchableOpacityProps & {
12
+ /** Valor exibido e retornado no onPressConfirm */
13
+ value: T | null;
14
+
15
+ /** Ícone à esquerda (padrão: 'CALENDAR') */
16
+ icon: keyof typeof SVG_NAME;
17
+
18
+ /** Desabilita interação */
19
+ disabled?: boolean;
20
+
21
+ /** Cor do texto (opcional) */
22
+ textColor?: string;
23
+
24
+ /** Clique confirma e devolve o value */
25
+ onPressConfirm: (value: T) => void;
26
+ };
27
+
28
+ /**
29
+ * EXPORTS
30
+ */
31
+ export type { IActivityFieldsProps };