react-native-exp-fig 0.1.0
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.
- package/LICENSE +20 -0
- package/README.md +119 -0
- package/package.json +200 -0
- package/react-native.config.js +4 -0
- package/src/assets/fonts/Inter-Black.ttf +0 -0
- package/src/assets/fonts/Inter-Bold.ttf +0 -0
- package/src/assets/fonts/Inter-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter-ExtraLight.ttf +0 -0
- package/src/assets/fonts/Inter-Light.ttf +0 -0
- package/src/assets/fonts/Inter-Medium.ttf +0 -0
- package/src/assets/fonts/Inter-Regular.ttf +0 -0
- package/src/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/src/assets/fonts/Inter-Thin.ttf +0 -0
- package/src/common/icons-svg/arrow-drop-down/index.tsx +28 -0
- package/src/common/icons-svg/arrow-left/index.tsx +32 -0
- package/src/common/icons-svg/bluetooth/index.tsx +37 -0
- package/src/common/icons-svg/bluetooth-connected/index.tsx +41 -0
- package/src/common/icons-svg/calendar/index.tsx +40 -0
- package/src/common/icons-svg/call-bell/index.tsx +29 -0
- package/src/common/icons-svg/camera-plus/index.tsx +40 -0
- package/src/common/icons-svg/check-box-fill/index.tsx +30 -0
- package/src/common/icons-svg/check-box-outline/index.tsx +30 -0
- package/src/common/icons-svg/check-circle/index.tsx +27 -0
- package/src/common/icons-svg/closed/index.tsx +34 -0
- package/src/common/icons-svg/constants/index.ts +43 -0
- package/src/common/icons-svg/credit-card/index.tsx +32 -0
- package/src/common/icons-svg/currency/index.tsx +39 -0
- package/src/common/icons-svg/eye/index.tsx +31 -0
- package/src/common/icons-svg/eye-slash/index.tsx +31 -0
- package/src/common/icons-svg/file-text/index.tsx +39 -0
- package/src/common/icons-svg/gas-pump/index.tsx +39 -0
- package/src/common/icons-svg/gauge/index.tsx +39 -0
- package/src/common/icons-svg/gear/index.tsx +39 -0
- package/src/common/icons-svg/index.tsx +149 -0
- package/src/common/icons-svg/interface.d.ts +18 -0
- package/src/common/icons-svg/list/index.tsx +58 -0
- package/src/common/icons-svg/moon-stars/index.tsx +29 -0
- package/src/common/icons-svg/note-pincel/index.tsx +40 -0
- package/src/common/icons-svg/package-check/index.tsx +45 -0
- package/src/common/icons-svg/shopping-cart/index.tsx +39 -0
- package/src/common/icons-svg/steering-wheel/index.tsx +49 -0
- package/src/common/icons-svg/steering-wheel-fill/index.tsx +36 -0
- package/src/common/icons-svg/timer/index.tsx +39 -0
- package/src/common/icons-svg/trophy/index.tsx +29 -0
- package/src/common/icons-svg/truck/index.tsx +39 -0
- package/src/common/icons-svg/wifi-high/index.tsx +43 -0
- package/src/common/icons-svg/wifi-x/index.tsx +50 -0
- package/src/components/box/index.tsx +47 -0
- package/src/components/box/interface.d.ts +31 -0
- package/src/components/box/styles.ts +21 -0
- package/src/components/button/index.tsx +61 -0
- package/src/components/button/interface.d.ts +40 -0
- package/src/components/button/styles.ts +34 -0
- package/src/components/capture-photo/index.tsx +125 -0
- package/src/components/capture-photo/interface.d.ts +44 -0
- package/src/components/capture-photo/styles.ts +24 -0
- package/src/components/card-hours/index.tsx +118 -0
- package/src/components/card-hours/interface.d.ts +37 -0
- package/src/components/card-scheduled-journey/index.tsx +138 -0
- package/src/components/card-scheduled-journey/interface.ts +42 -0
- package/src/components/card-scheduled-journey/styles.ts +26 -0
- package/src/components/header-profile/index.tsx +128 -0
- package/src/components/header-profile/interface.d.ts +52 -0
- package/src/components/input/index.tsx +180 -0
- package/src/components/input/interface.d.ts +55 -0
- package/src/components/input/styles.ts +23 -0
- package/src/components/scheduled-journey-indicators/index.tsx +99 -0
- package/src/components/scheduled-journey-indicators/interface.d.ts +18 -0
- package/src/components/selects/select-option/index.tsx +104 -0
- package/src/components/selects/select-option/interface.d.ts +18 -0
- package/src/components/selects/select-option/styles.ts +75 -0
- package/src/components/step-indicator/helpers/get-icon-by-status.tsx +20 -0
- package/src/components/step-indicator/index.tsx +164 -0
- package/src/components/step-indicator/interface.d.ts +34 -0
- package/src/components/step-indicator/styles.ts +67 -0
- package/src/components/typography/index.tsx +67 -0
- package/src/components/typography/interface.d.ts +102 -0
- package/src/components/typography/styles.ts +34 -0
- package/src/index.tsx +23 -0
- package/src/stories/box/box.stories.tsx +106 -0
- package/src/stories/button/button.stories.tsx +143 -0
- package/src/stories/capture-photo/capture-photo.stories.tsx +170 -0
- package/src/stories/card-hours/card-hours.stories.tsx +102 -0
- package/src/stories/card-scheduled-journey/card-scheduled-journey.stories.tsx +101 -0
- package/src/stories/header-profile/header-profile.stories.tsx +84 -0
- package/src/stories/input/input.stories.tsx +286 -0
- package/src/stories/scheduled-journey-indicators/sheduled-journey-indicators.stories.tsx +74 -0
- package/src/stories/select-option/select-option.stories.tsx +46 -0
- package/src/stories/step-indicator/step-indicator.stories.tsx +116 -0
- package/src/stories/typography/typography.stories.tsx +146 -0
- package/src/styles/global/interface.d.ts +131 -0
- package/src/styles/global/styles.ts +63 -0
- package/src/styles/global/theme-provider.tsx +10 -0
- package/src/styles/theme/theme.ts +156 -0
- package/src/utils/format-data/index.ts +14 -0
- package/src/utils/mutiply/index.ts +3 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Image, TouchableOpacity } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import { Typography } from "../typography";
|
|
9
|
+
|
|
10
|
+
// icons / svg
|
|
11
|
+
import { Icons } from "../../common/icons-svg";
|
|
12
|
+
|
|
13
|
+
// typings
|
|
14
|
+
import { ICapturePhotoProps } from "./interface";
|
|
15
|
+
|
|
16
|
+
// styles
|
|
17
|
+
import { theme } from "../../styles/theme/theme";
|
|
18
|
+
import { styles } from "./styles";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Componente Capturar foto para a interação do usuário com ui.
|
|
22
|
+
*/
|
|
23
|
+
const CapturePhoto: React.FC<ICapturePhotoProps> = ({
|
|
24
|
+
imageComprovante,
|
|
25
|
+
takePhotoWithImagePicker,
|
|
26
|
+
testID,
|
|
27
|
+
width,
|
|
28
|
+
height,
|
|
29
|
+
marginStyle,
|
|
30
|
+
flexStyle,
|
|
31
|
+
title,
|
|
32
|
+
borderStyled,
|
|
33
|
+
color,
|
|
34
|
+
fontStyle,
|
|
35
|
+
opacity,
|
|
36
|
+
style,
|
|
37
|
+
smallText,
|
|
38
|
+
paddingStyle,
|
|
39
|
+
}) => {
|
|
40
|
+
const styleProps = {
|
|
41
|
+
imageComprovante,
|
|
42
|
+
takePhotoWithImagePicker,
|
|
43
|
+
testID,
|
|
44
|
+
width,
|
|
45
|
+
height,
|
|
46
|
+
marginStyle,
|
|
47
|
+
flexStyle,
|
|
48
|
+
title,
|
|
49
|
+
borderStyled,
|
|
50
|
+
color,
|
|
51
|
+
fontStyle,
|
|
52
|
+
opacity,
|
|
53
|
+
style,
|
|
54
|
+
smallText,
|
|
55
|
+
paddingStyle,
|
|
56
|
+
} as ICapturePhotoProps;
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
{imageComprovante ? (
|
|
61
|
+
<TouchableOpacity activeOpacity={0.7} onPress={takePhotoWithImagePicker} testID={testID}>
|
|
62
|
+
<Image
|
|
63
|
+
style={[
|
|
64
|
+
{
|
|
65
|
+
width,
|
|
66
|
+
height,
|
|
67
|
+
borderWidth: Number(borderStyled?.borderWidth),
|
|
68
|
+
borderColor: borderStyled?.borderColor,
|
|
69
|
+
borderRadius: Number(borderStyled?.borderRadius),
|
|
70
|
+
},
|
|
71
|
+
styles(styleProps).capturePhoto,
|
|
72
|
+
]}
|
|
73
|
+
source={{ uri: imageComprovante }}
|
|
74
|
+
/>
|
|
75
|
+
</TouchableOpacity>
|
|
76
|
+
) : (
|
|
77
|
+
<TouchableOpacity
|
|
78
|
+
activeOpacity={0.7}
|
|
79
|
+
style={[styles(styleProps).capturePhoto, style]}
|
|
80
|
+
onPress={takePhotoWithImagePicker}
|
|
81
|
+
testID={testID}
|
|
82
|
+
>
|
|
83
|
+
<Icons icon={"CAMERA_PLUS"} size={theme.fontSizes["2xl"] || 24} color={color?.colorSvg} />
|
|
84
|
+
<Typography
|
|
85
|
+
text={title.text || "Sem foto capturada."}
|
|
86
|
+
align={
|
|
87
|
+
flexStyle?.textAlign === "left" || flexStyle?.textAlign === "right"
|
|
88
|
+
? flexStyle.textAlign
|
|
89
|
+
: "center"
|
|
90
|
+
}
|
|
91
|
+
color={color?.colorText ? color.colorText : theme.colors.gray[875]}
|
|
92
|
+
size={fontStyle?.fontSize ? fontStyle?.fontSize : theme.fontSizes.md}
|
|
93
|
+
fontFamily={
|
|
94
|
+
fontStyle?.fontFamily ? fontStyle?.fontFamily : theme.fonts.inter_regular_400
|
|
95
|
+
}
|
|
96
|
+
lineHeight={fontStyle?.lineHeight ? fontStyle?.lineHeight : theme.fontSizes["2xl"]}
|
|
97
|
+
letterSpacing={fontStyle?.letterSpacing ? fontStyle?.letterSpacing : "regular"}
|
|
98
|
+
/>
|
|
99
|
+
{smallText && (
|
|
100
|
+
<Typography
|
|
101
|
+
text={title.textSmallPhoto || "aqui vai o texto de baixo da foto"}
|
|
102
|
+
align={
|
|
103
|
+
flexStyle?.textAlign === "left" || flexStyle?.textAlign === "right"
|
|
104
|
+
? flexStyle.textAlign
|
|
105
|
+
: "center"
|
|
106
|
+
}
|
|
107
|
+
color={color?.colorText ? color.colorText : theme.colors.gray[875]}
|
|
108
|
+
size={fontStyle?.fontSize ? fontStyle?.fontSize : theme.fontSizes.sm}
|
|
109
|
+
fontFamily={
|
|
110
|
+
fontStyle?.fontFamily ? fontStyle?.fontFamily : theme.fonts.inter_regular_400
|
|
111
|
+
}
|
|
112
|
+
lineHeight={fontStyle?.lineHeight ? fontStyle?.lineHeight : theme.fontSizes.md}
|
|
113
|
+
letterSpacing={fontStyle?.letterSpacing ? fontStyle?.letterSpacing : "regular"}
|
|
114
|
+
/>
|
|
115
|
+
)}
|
|
116
|
+
</TouchableOpacity>
|
|
117
|
+
)}
|
|
118
|
+
</>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* EXPORTS
|
|
124
|
+
*/
|
|
125
|
+
export { CapturePhoto };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import { TouchableOpacityProps } from "react-native";
|
|
5
|
+
|
|
6
|
+
// typing
|
|
7
|
+
import { IGlobalCss } from "../../styles/global/interface";
|
|
8
|
+
|
|
9
|
+
interface ICapturePhotoProps extends TouchableOpacityProps, IGlobalCss {
|
|
10
|
+
/**
|
|
11
|
+
* Estilo customizado
|
|
12
|
+
*/
|
|
13
|
+
style?: any;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Função que tira uma foto.
|
|
17
|
+
*/
|
|
18
|
+
takePhotoWithImagePicker: () => void;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Valor com a foto do capturada
|
|
22
|
+
*/
|
|
23
|
+
imageComprovante: string | null;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A propriedade CSS opacity define a transparência de um elemento, ou seja, o grau em que o fundo atrás do elemento é sobreposto. A propriedade aceita um valor entre 0,0 (totalmente transparente) e 1,0 (totalmente opaco).
|
|
27
|
+
*/
|
|
28
|
+
opacity?: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A propriedade smallPhoto define quando vai ser foto pequena exemplo para manutenção : foto1 em baixo o texto informando o lado :direito , esquerdo ou frente.
|
|
32
|
+
*/
|
|
33
|
+
smallText: boolean;
|
|
34
|
+
|
|
35
|
+
title: {
|
|
36
|
+
text: string;
|
|
37
|
+
textSmallPhoto?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* EXPORTS
|
|
43
|
+
*/
|
|
44
|
+
export type { ICapturePhotoProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import { StyleSheet } from "react-native";
|
|
5
|
+
|
|
6
|
+
// typing
|
|
7
|
+
import { ICapturePhotoProps } from "./interface";
|
|
8
|
+
import { stylesGlobal } from "../../styles/global/styles";
|
|
9
|
+
import { IGlobalCss } from "../../styles/global/interface";
|
|
10
|
+
|
|
11
|
+
interface CapturePhotoProps extends ICapturePhotoProps, IGlobalCss {}
|
|
12
|
+
const styles = (props: CapturePhotoProps) =>
|
|
13
|
+
StyleSheet.create({
|
|
14
|
+
capturePhoto: {
|
|
15
|
+
...stylesGlobal(props),
|
|
16
|
+
opacity: props.opacity,
|
|
17
|
+
...props,
|
|
18
|
+
} as IGlobalCss,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* EXPORTS
|
|
23
|
+
*/
|
|
24
|
+
export { styles };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/ import React from "react";
|
|
4
|
+
|
|
5
|
+
// components
|
|
6
|
+
import { Box } from "../box";
|
|
7
|
+
import { Typography } from "../typography";
|
|
8
|
+
|
|
9
|
+
// typing
|
|
10
|
+
import { ICardHoursProps } from "./interface";
|
|
11
|
+
|
|
12
|
+
// styles
|
|
13
|
+
import { theme } from "../../styles/theme/theme";
|
|
14
|
+
|
|
15
|
+
const CardHours: React.FC<ICardHoursProps> = ({
|
|
16
|
+
hoursWorked,
|
|
17
|
+
handleFormatDataInDayMonthYearNotHours,
|
|
18
|
+
width,
|
|
19
|
+
height,
|
|
20
|
+
marginStyle,
|
|
21
|
+
paddingStyle,
|
|
22
|
+
flexStyle,
|
|
23
|
+
text,
|
|
24
|
+
borderStyled,
|
|
25
|
+
color,
|
|
26
|
+
fontStyle,
|
|
27
|
+
backgroundColor,
|
|
28
|
+
sizeHours,
|
|
29
|
+
sizeDescription,
|
|
30
|
+
style,
|
|
31
|
+
testID,
|
|
32
|
+
}) => {
|
|
33
|
+
const styleProps = {
|
|
34
|
+
width,
|
|
35
|
+
height,
|
|
36
|
+
marginStyle,
|
|
37
|
+
paddingStyle,
|
|
38
|
+
flexStyle,
|
|
39
|
+
text,
|
|
40
|
+
borderStyled,
|
|
41
|
+
color,
|
|
42
|
+
fontStyle,
|
|
43
|
+
backgroundColor,
|
|
44
|
+
sizeHours,
|
|
45
|
+
sizeDescription,
|
|
46
|
+
style,
|
|
47
|
+
testID,
|
|
48
|
+
} as ICardHoursProps;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Box
|
|
52
|
+
testID={testID}
|
|
53
|
+
width={width ?? "100%"}
|
|
54
|
+
height={height}
|
|
55
|
+
backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
|
|
56
|
+
borderStyled={{
|
|
57
|
+
borderWidth: borderStyled?.borderWidth ?? theme.borderWidths.thin,
|
|
58
|
+
borderColor: borderStyled?.borderColor ?? theme.colors.gray[400],
|
|
59
|
+
borderRadius: borderStyled?.borderRadius ?? theme.borderWidths.thick_medium,
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
<Typography
|
|
63
|
+
text={text ?? "Informe texto:"}
|
|
64
|
+
size={Number(styleProps.fontStyle?.fontSize)}
|
|
65
|
+
fontFamily={styleProps.fontStyle?.fontFamily}
|
|
66
|
+
color={color?.colorText ?? theme.colors.gray[700]}
|
|
67
|
+
lineHeight={fontStyle?.lineHeight ?? theme.fontSizes.xl}
|
|
68
|
+
letterSpacing={"regular"}
|
|
69
|
+
paddingTop={theme.paddings["2xs"]}
|
|
70
|
+
paddingLeft={theme.paddings["2xs"]}
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<Box
|
|
74
|
+
flexStyle={{
|
|
75
|
+
flexDirection: "row",
|
|
76
|
+
alignItems: "flex-end",
|
|
77
|
+
justifyContent: "space-between",
|
|
78
|
+
}}
|
|
79
|
+
paddingStyle={{
|
|
80
|
+
paddingLeft: theme.paddings["2xs"],
|
|
81
|
+
paddingRight: theme.paddings["2xs"],
|
|
82
|
+
}}
|
|
83
|
+
backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
|
|
84
|
+
width={"100%"}
|
|
85
|
+
borderStyled={{
|
|
86
|
+
borderBottomLeftRadius:
|
|
87
|
+
borderStyled?.borderBottomLeftRadius ?? theme.borderWidths.thick_medium,
|
|
88
|
+
borderBottomRightRadius:
|
|
89
|
+
borderStyled?.borderBottomRightRadius ?? theme.borderWidths.thick_medium,
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<Typography
|
|
93
|
+
text={`${hoursWorked ?? "00:00 H"}`}
|
|
94
|
+
size={sizeHours ?? theme.fontSizes["3xl"]}
|
|
95
|
+
fontFamily={theme.fonts.inter_bold ?? "inter_bold"}
|
|
96
|
+
fontWeight="700"
|
|
97
|
+
color={color?.colorTextBold ?? theme.colors.orange[150]}
|
|
98
|
+
lineHeight={fontStyle?.lineHeight ?? theme.fontSizes["5xl"]}
|
|
99
|
+
letterSpacing={"regular"}
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
<Typography
|
|
103
|
+
text={`Última atualização: ${handleFormatDataInDayMonthYearNotHours(new Date())}`}
|
|
104
|
+
size={sizeDescription ?? theme.fontSizes.xs}
|
|
105
|
+
fontFamily={"inter_light_300"}
|
|
106
|
+
color={color?.colorTextData ?? theme.colors.gray[700]}
|
|
107
|
+
lineHeight={fontStyle?.lineHeight ?? theme.fontSizes["xl"]}
|
|
108
|
+
letterSpacing={"regular"}
|
|
109
|
+
/>
|
|
110
|
+
</Box>
|
|
111
|
+
</Box>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* EXPORTS
|
|
117
|
+
*/
|
|
118
|
+
export { CardHours };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import { ViewProps } from "react-native";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* INTERFACE
|
|
8
|
+
*/
|
|
9
|
+
import { IGlobalCss } from "../../styles/global/interface";
|
|
10
|
+
|
|
11
|
+
interface ICardHoursProps extends ViewProps, IGlobalCss {
|
|
12
|
+
/**
|
|
13
|
+
* props que mostra os valores de horas trabalhadas
|
|
14
|
+
*/
|
|
15
|
+
hoursWorked: string | null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* props que mostra a data do horário correspondentes para a ultima atualização
|
|
19
|
+
*/
|
|
20
|
+
// eslint-disable-next-line no-unused-vars
|
|
21
|
+
handleFormatDataInDayMonthYearNotHours: (date: Date) => {};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* props que mostra o tamanho da fonte
|
|
25
|
+
*/
|
|
26
|
+
sizeDescription?: number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* props que mostra o tamanho da fonte
|
|
30
|
+
*/
|
|
31
|
+
sizeHours?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* EXPORTS
|
|
36
|
+
*/
|
|
37
|
+
export type { ICardHoursProps };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Dimensions } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import { Box } from "../box";
|
|
9
|
+
import { Typography } from "../typography";
|
|
10
|
+
|
|
11
|
+
// typings
|
|
12
|
+
import { ICardScheduledJourney } from "./interface";
|
|
13
|
+
|
|
14
|
+
// styles
|
|
15
|
+
import { theme } from "../../styles/theme/theme";
|
|
16
|
+
|
|
17
|
+
// icons / svg
|
|
18
|
+
import { Icons } from "../../common/icons-svg";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Componente CardScheduledJourney para a interação da ui.
|
|
22
|
+
*/
|
|
23
|
+
const CardScheduledJourney: React.FC<ICardScheduledJourney> = ({
|
|
24
|
+
title,
|
|
25
|
+
duracao,
|
|
26
|
+
color = {},
|
|
27
|
+
backgroundColor,
|
|
28
|
+
borderStyled,
|
|
29
|
+
paddingStyle,
|
|
30
|
+
marginStyle,
|
|
31
|
+
flexStyle,
|
|
32
|
+
style,
|
|
33
|
+
width,
|
|
34
|
+
widthChildren,
|
|
35
|
+
icon,
|
|
36
|
+
borderRight,
|
|
37
|
+
}) => {
|
|
38
|
+
const { width: widthScreen } = Dimensions.get("window");
|
|
39
|
+
const isMobile = widthScreen < 768;
|
|
40
|
+
return (
|
|
41
|
+
<Box
|
|
42
|
+
style={style}
|
|
43
|
+
width={width}
|
|
44
|
+
height={80}
|
|
45
|
+
backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
|
|
46
|
+
borderStyled={{
|
|
47
|
+
borderWidth: borderStyled?.borderWidth ?? theme.borderWidths.thin,
|
|
48
|
+
borderRadius: borderStyled?.borderRadius ?? theme.borderWidths.thick,
|
|
49
|
+
borderColor: borderStyled?.borderColor ?? theme.colors.gray[700],
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
{/**CHILDREN */}
|
|
53
|
+
<Box
|
|
54
|
+
flexStyle={{
|
|
55
|
+
flexDirection: "row",
|
|
56
|
+
justifyContent: "space-between",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
}}
|
|
59
|
+
backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
|
|
60
|
+
width={widthChildren}
|
|
61
|
+
borderStyled={{
|
|
62
|
+
borderRadius: borderStyled?.borderRadius ?? theme.borderWidths.thick,
|
|
63
|
+
}}
|
|
64
|
+
paddingStyle={{
|
|
65
|
+
paddingLeft: paddingStyle?.paddingLeft ?? 8,
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{/**ICONE*/}
|
|
69
|
+
<Box
|
|
70
|
+
width={65}
|
|
71
|
+
height={65}
|
|
72
|
+
backgroundColor={backgroundColor ?? theme.colors.neutral[25]}
|
|
73
|
+
flexStyle={{
|
|
74
|
+
flexDirection: flexStyle?.flexDirection ?? "column",
|
|
75
|
+
justifyContent: flexStyle?.justifyContent ?? "center",
|
|
76
|
+
alignItems: flexStyle?.alignItems ?? "center",
|
|
77
|
+
}}
|
|
78
|
+
borderStyled={{
|
|
79
|
+
borderWidth: borderStyled?.borderWidth ?? theme.borderWidths.thin,
|
|
80
|
+
borderRadius: borderStyled?.borderRadius ?? theme.borderWidths.thick,
|
|
81
|
+
borderColor: borderStyled?.borderColor ?? theme.colors.gray[700],
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
{icon && <Icons icon={icon} size={theme.fontSizes["2xl"]} />}
|
|
85
|
+
</Box>
|
|
86
|
+
|
|
87
|
+
{/**TITLE E DESCRIÇÃO */}
|
|
88
|
+
<Box
|
|
89
|
+
width={isMobile ? "72%" : "90%"}
|
|
90
|
+
backgroundColor={theme.colors.neutral[25]}
|
|
91
|
+
flexStyle={{
|
|
92
|
+
flexDirection: "column",
|
|
93
|
+
justifyContent: "space-between",
|
|
94
|
+
}}
|
|
95
|
+
marginStyle={{ marginTop: marginStyle?.marginTop ?? -20 }}
|
|
96
|
+
>
|
|
97
|
+
<Typography
|
|
98
|
+
text={title}
|
|
99
|
+
size={theme.fontSizes.sm}
|
|
100
|
+
fontWeight={"700"}
|
|
101
|
+
fontFamily={theme.fonts.inter_bold_700}
|
|
102
|
+
color={color.colorText ?? theme.colors.black[25]}
|
|
103
|
+
lineHeight={theme.fontSizes["2xl"]}
|
|
104
|
+
letterSpacing={"regular"}
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<Typography
|
|
108
|
+
text={`Duração: ${duracao}`}
|
|
109
|
+
size={theme.fontSizes.sm}
|
|
110
|
+
fontWeight={"300"}
|
|
111
|
+
fontFamily={theme.fonts.inter_light_300}
|
|
112
|
+
color={color.colorText ?? theme.colors.black[25]}
|
|
113
|
+
lineHeight={theme.fontSizes["2xl"]}
|
|
114
|
+
letterSpacing={"regular"}
|
|
115
|
+
/>
|
|
116
|
+
</Box>
|
|
117
|
+
|
|
118
|
+
{/**BORDAR */}
|
|
119
|
+
<Box
|
|
120
|
+
width={12}
|
|
121
|
+
height={79}
|
|
122
|
+
backgroundColor={borderRight ?? theme.colors.green[400]}
|
|
123
|
+
borderStyled={{
|
|
124
|
+
borderWidth: theme.borderWidths.thin,
|
|
125
|
+
borderTopRightRadius: theme.borderWidths.thick,
|
|
126
|
+
borderBottomRightRadius: theme.borderWidths.thick,
|
|
127
|
+
borderColor: borderRight ?? theme.colors.green[400],
|
|
128
|
+
}}
|
|
129
|
+
/>
|
|
130
|
+
</Box>
|
|
131
|
+
</Box>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* EXPORTS
|
|
137
|
+
*/
|
|
138
|
+
export { CardScheduledJourney };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import { DimensionValue, ViewProps } from "react-native";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* INTERFACE
|
|
8
|
+
*/
|
|
9
|
+
import { IGlobalCss } from "../../styles/global/interface";
|
|
10
|
+
import { SVG_NAME } from "../../common/icons-svg/constants";
|
|
11
|
+
|
|
12
|
+
interface ICardScheduledJourney extends ViewProps, IGlobalCss {
|
|
13
|
+
/**
|
|
14
|
+
* props que mostra o titulo correspondentes para a ultima atualização
|
|
15
|
+
*/
|
|
16
|
+
title: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* props que mostra a duração correspondentes para a ultima atualização
|
|
20
|
+
*/
|
|
21
|
+
duracao: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A propriedade CSS width define a largura de um elemento. A largura de um elemento é a distância do topo da borda esquerda do elemento ao fundo da borda direita.
|
|
25
|
+
*/
|
|
26
|
+
widthChildren?: number | DimensionValue;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A propriedade que define o tipo que icones serao usados
|
|
30
|
+
*/
|
|
31
|
+
icon?: keyof typeof SVG_NAME;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A propriedade CSS borderRight define a cor de fundo de um elemento do lado direito.
|
|
35
|
+
*/
|
|
36
|
+
borderRight?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* EXPORTS
|
|
41
|
+
*/
|
|
42
|
+
export type { ICardScheduledJourney };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import { StyleSheet } from "react-native";
|
|
5
|
+
|
|
6
|
+
// typing
|
|
7
|
+
import { ICardScheduledJourney } from "./interface";
|
|
8
|
+
import { IGlobalCss } from "../../styles/global/interface";
|
|
9
|
+
|
|
10
|
+
// styles
|
|
11
|
+
import { stylesGlobal } from "../../styles/global/styles";
|
|
12
|
+
|
|
13
|
+
interface CardScheduledJourneyProps extends ICardScheduledJourney, IGlobalCss {}
|
|
14
|
+
|
|
15
|
+
const styles = (props: CardScheduledJourneyProps) =>
|
|
16
|
+
StyleSheet.create({
|
|
17
|
+
cardScheduledJourney: {
|
|
18
|
+
...stylesGlobal(props),
|
|
19
|
+
...props,
|
|
20
|
+
} as ICardScheduledJourney,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* EXPORTS
|
|
25
|
+
*/
|
|
26
|
+
export { styles };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Dimensions, TouchableOpacity } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import { Box } from "../box";
|
|
9
|
+
import { Typography } from "../typography";
|
|
10
|
+
|
|
11
|
+
// typings
|
|
12
|
+
import { IHeaderProps } from "./interface";
|
|
13
|
+
|
|
14
|
+
// commons
|
|
15
|
+
import { Icons } from "../../common/icons-svg";
|
|
16
|
+
|
|
17
|
+
// styles
|
|
18
|
+
import { theme } from "../../styles/theme/theme";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Componente Header para a interação do usuário com ui.
|
|
22
|
+
*/
|
|
23
|
+
const Header: React.FC<IHeaderProps> = ({
|
|
24
|
+
title,
|
|
25
|
+
color,
|
|
26
|
+
testID,
|
|
27
|
+
arrow,
|
|
28
|
+
// propsNav,
|
|
29
|
+
permission,
|
|
30
|
+
bluetoothIsConnected,
|
|
31
|
+
isInternetReachable,
|
|
32
|
+
handleNavigation,
|
|
33
|
+
}) => {
|
|
34
|
+
const { width: widthScreen } = Dimensions.get("window");
|
|
35
|
+
const isMobile = widthScreen < 768;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Box
|
|
39
|
+
testID={testID}
|
|
40
|
+
width={"100%"}
|
|
41
|
+
height={45}
|
|
42
|
+
backgroundColor={theme.colors.blue[500]}
|
|
43
|
+
flexStyle={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center" }}
|
|
44
|
+
>
|
|
45
|
+
<Box
|
|
46
|
+
width={"10%"}
|
|
47
|
+
height={45}
|
|
48
|
+
backgroundColor={theme.colors.blue[500]}
|
|
49
|
+
flexStyle={{ flexDirection: "column", justifyContent: "center", alignItems: "flex-start" }}
|
|
50
|
+
paddingStyle={{ paddingLeft: 16 }}
|
|
51
|
+
>
|
|
52
|
+
{arrow && title !== "Login" && (
|
|
53
|
+
<TouchableOpacity
|
|
54
|
+
disabled={!arrow}
|
|
55
|
+
onPress={handleNavigation}
|
|
56
|
+
style={{
|
|
57
|
+
width: 50,
|
|
58
|
+
height: 45,
|
|
59
|
+
flexDirection: "column",
|
|
60
|
+
alignItems: "flex-start",
|
|
61
|
+
justifyContent: "center",
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{title === "Controle de Jornada" ? (
|
|
65
|
+
<>
|
|
66
|
+
<Icons icon="LIST" color="#fff" />
|
|
67
|
+
<Box marginStyle={{ marginBottom: 8 }} />
|
|
68
|
+
</>
|
|
69
|
+
) : (
|
|
70
|
+
arrow && <Icons icon="ARROW_LEFT" />
|
|
71
|
+
)}
|
|
72
|
+
</TouchableOpacity>
|
|
73
|
+
)}
|
|
74
|
+
</Box>
|
|
75
|
+
|
|
76
|
+
<Box
|
|
77
|
+
width={"68%"}
|
|
78
|
+
height={45}
|
|
79
|
+
flexStyle={{
|
|
80
|
+
flexDirection: "row",
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
flex: 0.9,
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
<Typography
|
|
87
|
+
text={title ? title : "Login"}
|
|
88
|
+
size={15.4}
|
|
89
|
+
fontFamily="inter_bold"
|
|
90
|
+
color={color?.colorText ?? theme.colors.neutral[25]}
|
|
91
|
+
lineHeight={theme.fontSizes["2xl"]}
|
|
92
|
+
letterSpacing={"regular"}
|
|
93
|
+
marginLeft={30}
|
|
94
|
+
/>
|
|
95
|
+
</Box>
|
|
96
|
+
|
|
97
|
+
<Box
|
|
98
|
+
marginStyle={{ marginRight: isMobile ? 10 : 60 }}
|
|
99
|
+
borderStyled={{ borderRadius: 10 }}
|
|
100
|
+
width={50}
|
|
101
|
+
height={24}
|
|
102
|
+
>
|
|
103
|
+
{permission ? (
|
|
104
|
+
<Box marginStyle={{ marginTop: 2 }} />
|
|
105
|
+
) : (
|
|
106
|
+
<Box
|
|
107
|
+
marginStyle={{ marginTop: 2 }}
|
|
108
|
+
flexStyle={{ flexDirection: "row", justifyContent: "space-between" }}
|
|
109
|
+
>
|
|
110
|
+
<Icons
|
|
111
|
+
icon={bluetoothIsConnected ? "BLUETOOTH_CONNECTED" : "BLUETOOTH"}
|
|
112
|
+
color={bluetoothIsConnected ? theme.colors.green[400] : theme.colors.red[900]}
|
|
113
|
+
/>
|
|
114
|
+
<Icons
|
|
115
|
+
icon={isInternetReachable ? "WIFI_HIGH" : "WIFI_X"}
|
|
116
|
+
color={isInternetReachable ? theme.colors.orange[150] : theme.colors.red[800]}
|
|
117
|
+
/>
|
|
118
|
+
</Box>
|
|
119
|
+
)}
|
|
120
|
+
</Box>
|
|
121
|
+
</Box>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* EXPORTS
|
|
127
|
+
*/
|
|
128
|
+
export { Header };
|