jornada-ui 0.4.14 → 0.4.15

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 (23) hide show
  1. package/lib/commonjs/components/activities-progress/index.js +10 -10
  2. package/lib/commonjs/components/activities-progress/index.js.map +1 -1
  3. package/lib/commonjs/components/card-work-session/index.js +50 -17
  4. package/lib/commonjs/components/card-work-session/index.js.map +1 -1
  5. package/lib/commonjs/stories/card-work-session/card-work-session.stories.js +62 -9
  6. package/lib/commonjs/stories/card-work-session/card-work-session.stories.js.map +1 -1
  7. package/lib/module/components/activities-progress/index.js +10 -10
  8. package/lib/module/components/activities-progress/index.js.map +1 -1
  9. package/lib/module/components/card-work-session/index.js +50 -17
  10. package/lib/module/components/card-work-session/index.js.map +1 -1
  11. package/lib/module/stories/card-work-session/card-work-session.stories.js +62 -9
  12. package/lib/module/stories/card-work-session/card-work-session.stories.js.map +1 -1
  13. package/lib/typescript/commonjs/src/components/card-work-session/index.d.ts +2 -1
  14. package/lib/typescript/commonjs/src/components/card-work-session/index.d.ts.map +1 -1
  15. package/lib/typescript/commonjs/src/stories/card-work-session/card-work-session.stories.d.ts.map +1 -1
  16. package/lib/typescript/module/src/components/card-work-session/index.d.ts +2 -1
  17. package/lib/typescript/module/src/components/card-work-session/index.d.ts.map +1 -1
  18. package/lib/typescript/module/src/stories/card-work-session/card-work-session.stories.d.ts.map +1 -1
  19. package/package.json +1 -1
  20. package/src/components/activities-progress/index.tsx +172 -172
  21. package/src/components/card-work-session/index.tsx +190 -172
  22. package/src/components/card-work-session/interface.d.ts +151 -150
  23. package/src/stories/card-work-session/card-work-session.stories.tsx +106 -53
@@ -1,172 +1,190 @@
1
- /**
2
- * Imports
3
- */
4
- import React, { forwardRef } from "react";
5
- import { Image, TouchableOpacity } from "react-native";
6
-
7
- // components
8
- import Box from "../box";
9
- import Typography from "../typography";
10
-
11
- // commons / icons
12
- import { Icons } from "../../common/icons-svg";
13
- import { IMAGES } from "../../common/constants";
14
-
15
- // typings
16
- import { type ICardWorkSession } from "./interface";
17
-
18
- // styles
19
- import { theme } from "../../styles/theme/theme";
20
- import { asBaseComponent } from "../../@types/as-base-component";
21
-
22
- const CardWorkSession = forwardRef<any, ICardWorkSession>((props, ref): React.ReactElement => {
23
- const {
24
- name = "Weverson L.S",
25
- workDate = "25/01/2025",
26
- timeWork = "",
27
- initialTime = "11:40",
28
- duration = "05:20",
29
- avatar = "",
30
- backgroundColor,
31
- width,
32
- handleNavigation,
33
- } = props;
34
- return (
35
- <Box
36
- ref={ref}
37
- width={width}
38
- paddingStyle={{ padding: theme.paddings.md }}
39
- borderStyled={{
40
- borderBottomWidth: theme.borderWidths.thin,
41
- borderColor: backgroundColor ?? theme.colors.neutral[200],
42
- }}
43
- backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
44
- style={{
45
- position: "relative",
46
- }}
47
- >
48
- {/* Cabeçalho com imagem e ícone */}
49
- <Box
50
- flexStyle={{
51
- flexDirection: "row",
52
- justifyContent: "space-between",
53
- alignItems: "center",
54
- }}
55
- >
56
- <TouchableOpacity onPress={handleNavigation}>
57
- <Image
58
- style={{
59
- width: 50,
60
- height: 50,
61
- borderRadius: 25,
62
- borderWidth: theme.borderWidths.thin_medium,
63
- borderColor: theme.colors.blue[500],
64
- }}
65
- source={{ uri: avatar || IMAGES.IMAGE_ANONIMA }}
66
- />
67
- </TouchableOpacity>
68
-
69
- <Box style={{ position: "absolute", left: 57, top: 5 }}>
70
- <Box flexStyle={{ flexDirection: "row" }} marginStyle={{ marginTop: -5 }}>
71
- <Typography
72
- text={"Jornada Trabalho: "}
73
- fontFamily={theme.fonts.inter_bold_700}
74
- size={12}
75
- color={theme.colors.black[100]}
76
- letterSpacing={"regular"}
77
- />
78
- <Typography
79
- text={workDate}
80
- size={12}
81
- fontFamily={theme.fonts.inter_regular_400}
82
- color={theme.colors.gray[800]}
83
- />
84
- </Box>
85
-
86
- <Box flexStyle={{ flexDirection: "row" }} marginStyle={{ marginTop: -5 }}>
87
- <Typography
88
- text={"Tempo Jornada: "}
89
- size={11}
90
- color={theme.colors.black[100]}
91
- fontFamily={theme.fonts.inter_bold_700}
92
- letterSpacing={"regular"}
93
- />
94
-
95
- <Typography
96
- text={timeWork}
97
- size={11}
98
- fontFamily={theme.fonts.inter_regular_400}
99
- color={theme.colors.gray[800]}
100
- letterSpacing={"regular"}
101
- />
102
- </Box>
103
- </Box>
104
-
105
- <Icons icon={"BELL"} size={28} />
106
- </Box>
107
-
108
- <Box
109
- flexStyle={{
110
- flexDirection: "row",
111
- justifyContent: "space-between",
112
- alignItems: "center",
113
- }}
114
- >
115
- <Typography
116
- text={`Olá, ${name}`}
117
- size={16}
118
- color={theme.colors.black[100]}
119
- fontFamily={theme.fonts.inter_bold_700}
120
- marginLeft={-5}
121
- />
122
-
123
- {/* Seção de horário */}
124
- <Box flexStyle={{ flexDirection: "row" }}>
125
- <Box marginStyle={{ marginRight: 15 }}>
126
- <Typography
127
- text={`${initialTime}`}
128
- size={15}
129
- align="center"
130
- color={theme.colors.black[100]}
131
- fontFamily={theme.fonts.inter_semi_bold_600}
132
- />
133
-
134
- <Typography
135
- text={"INÍCIO"}
136
- size={10}
137
- align="center"
138
- color={theme.colors.neutral[200]}
139
- fontFamily={theme.fonts.inter_medium_500}
140
- marginTop={-8}
141
- />
142
- </Box>
143
- <Box>
144
- <Typography
145
- text={`${duration}`}
146
- size={15}
147
- align="center"
148
- color={theme.colors.black[100]}
149
- fontFamily={theme.fonts.inter_semi_bold_600}
150
- />
151
-
152
- <Typography
153
- text={"DURAÇÃO"}
154
- size={10}
155
- align="center"
156
- color={theme.colors.neutral[200]}
157
- fontFamily={theme.fonts.inter_medium_500}
158
- marginTop={-8}
159
- />
160
- </Box>
161
- </Box>
162
- </Box>
163
- </Box>
164
- );
165
- });
166
-
167
- CardWorkSession.displayName = "CardWorkSession";
168
-
169
- /**
170
- * Componente CardWorkSession para a interação da ui.
171
- */
172
- export default asBaseComponent(CardWorkSession);
1
+ /**
2
+ * Imports
3
+ */
4
+ import React, { forwardRef } from "react";
5
+ import { Image, TouchableOpacity } from "react-native";
6
+
7
+ // components
8
+ import Box from "../box";
9
+ import Typography from "../typography";
10
+
11
+ // commons / icons
12
+ import { Icons } from "../../common/icons-svg";
13
+ import { IMAGES } from "../../common/constants";
14
+
15
+ // typings
16
+ import { type ICardWorkSession } from "./interface";
17
+
18
+ // styles
19
+ import { theme } from "../../styles/theme/theme";
20
+ import { asBaseComponent } from "../../@types/as-base-component";
21
+
22
+ const CardWorkSession = forwardRef<any, ICardWorkSession>((props, ref): React.ReactElement => {
23
+ const {
24
+ name = "Weverson L.S",
25
+ workDate = "25/01/2025",
26
+ initialTime = "11:40",
27
+ duration = "05:20",
28
+ avatar = "",
29
+ backgroundColor,
30
+ width,
31
+ handleNavigation,
32
+ handleNavigationNotification,
33
+ counterBadge,
34
+ } = props;
35
+ return (
36
+ <Box
37
+ ref={ref}
38
+ width={width}
39
+ paddingStyle={{ padding: theme.paddings.md }}
40
+ borderStyled={{
41
+ borderBottomWidth: theme.borderWidths.thin,
42
+ borderColor: backgroundColor ?? theme.colors.neutral[200],
43
+ }}
44
+ backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
45
+ style={{
46
+ position: "relative",
47
+ }}
48
+ >
49
+ {/* Cabeçalho com imagem e ícone */}
50
+ <Box
51
+ flexStyle={{
52
+ flexDirection: "row",
53
+ justifyContent: "space-between",
54
+ alignItems: "center",
55
+ }}
56
+ >
57
+ <TouchableOpacity onPress={handleNavigation}>
58
+ <Image
59
+ style={{
60
+ width: 50,
61
+ height: 50,
62
+ borderRadius: 25,
63
+ borderWidth: theme.borderWidths.thin_medium,
64
+ borderColor: theme.colors.blue[500],
65
+ }}
66
+ source={{ uri: avatar || IMAGES.IMAGE_ANONIMA }}
67
+ />
68
+ </TouchableOpacity>
69
+
70
+ <Box style={{ position: "absolute", left: 57, top: 5 }}>
71
+ <Box flexStyle={{ flexDirection: "row" }} marginStyle={{ marginTop: -5 }}>
72
+ <Typography
73
+ text={"Jornada Trabalho: "}
74
+ fontFamily={theme.fonts.inter_bold_700}
75
+ size={12}
76
+ color={theme.colors.black[100]}
77
+ letterSpacing={"regular"}
78
+ />
79
+ <Typography
80
+ text={workDate}
81
+ size={12}
82
+ fontFamily={theme.fonts.inter_regular_400}
83
+ color={theme.colors.gray[800]}
84
+ />
85
+ </Box>
86
+
87
+ <Box flexStyle={{ flexDirection: "row" }} marginStyle={{ marginTop: -5 }}>
88
+ <Typography
89
+ text={"Tempo Jornada: "}
90
+ size={11}
91
+ color={theme.colors.black[100]}
92
+ fontFamily={theme.fonts.inter_bold_700}
93
+ letterSpacing={"regular"}
94
+ />
95
+ </Box>
96
+ </Box>
97
+
98
+ <TouchableOpacity activeOpacity={0.7} onPress={handleNavigationNotification}>
99
+ {counterBadge > 0 && (
100
+ <Box
101
+ backgroundColor={theme.colors.red[500]}
102
+ flexStyle={{ alignItems: "center", justifyContent: "center" }}
103
+ borderStyled={{ borderRadius: theme.borderWidths.hairline }}
104
+ style={[
105
+ counterBadge < 10
106
+ ? { right: -5, top: -2, height: 16, width: 16 }
107
+ : { right: -8, top: -5, padding: 2 },
108
+ { position: "absolute", zIndex: 10 },
109
+ ]}
110
+ >
111
+ <Typography
112
+ text={`${counterBadge}`}
113
+ align={"center"}
114
+ size={theme.fontSizes["2xs"]}
115
+ color={theme.colors.neutral[25]}
116
+ fontFamily={theme.fonts.inter_bold_700}
117
+ lineHeight={theme.fontSizes.sm}
118
+ letterSpacing={"regular"}
119
+ />
120
+ </Box>
121
+ )}
122
+ <Icons icon={"BELL"} size={28} style={{ position: "relative" }} />
123
+ </TouchableOpacity>
124
+ </Box>
125
+
126
+ <Box
127
+ flexStyle={{
128
+ flexDirection: "row",
129
+ justifyContent: "space-between",
130
+ alignItems: "center",
131
+ }}
132
+ >
133
+ <Typography
134
+ text={`Olá, ${name}`}
135
+ size={16}
136
+ color={theme.colors.black[100]}
137
+ fontFamily={theme.fonts.inter_bold_700}
138
+ marginLeft={-5}
139
+ />
140
+
141
+ {/* Seção de horário */}
142
+ <Box flexStyle={{ flexDirection: "row" }}>
143
+ <Box marginStyle={{ marginRight: 15 }}>
144
+ <Typography
145
+ text={`${initialTime}`}
146
+ size={15}
147
+ align="center"
148
+ color={theme.colors.black[100]}
149
+ fontFamily={theme.fonts.inter_semi_bold_600}
150
+ />
151
+
152
+ <Typography
153
+ text={"INÍCIO"}
154
+ size={10}
155
+ align="center"
156
+ color={theme.colors.neutral[200]}
157
+ fontFamily={theme.fonts.inter_medium_500}
158
+ marginTop={-8}
159
+ />
160
+ </Box>
161
+ <Box>
162
+ <Typography
163
+ text={`${duration}`}
164
+ size={15}
165
+ align="center"
166
+ color={theme.colors.black[100]}
167
+ fontFamily={theme.fonts.inter_semi_bold_600}
168
+ />
169
+
170
+ <Typography
171
+ text={"DURAÇÃO"}
172
+ size={10}
173
+ align="center"
174
+ color={theme.colors.neutral[200]}
175
+ fontFamily={theme.fonts.inter_medium_500}
176
+ marginTop={-8}
177
+ />
178
+ </Box>
179
+ </Box>
180
+ </Box>
181
+ </Box>
182
+ );
183
+ });
184
+
185
+ CardWorkSession.displayName = "CardWorkSession";
186
+
187
+ /**
188
+ * Componente CardWorkSession para a interação da ui.
189
+ */
190
+ export default asBaseComponent(CardWorkSession);