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,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { View, Text } from "react-native";
|
|
6
|
+
|
|
7
|
+
import { getIconKeyByValue } from "./helpers/get-icon-by-status";
|
|
8
|
+
|
|
9
|
+
// typings
|
|
10
|
+
import { IStepIndicator } from "./interface";
|
|
11
|
+
|
|
12
|
+
// styles
|
|
13
|
+
import { styles } from "./styles";
|
|
14
|
+
import { Icons } from "../../common/icons-svg";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Componente StepIndicator para a interação da ui.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const StepIndicator: React.FC<IStepIndicator> = ({
|
|
21
|
+
data = [],
|
|
22
|
+
type,
|
|
23
|
+
backgroundColorBall,
|
|
24
|
+
textColorDescription,
|
|
25
|
+
titleColor,
|
|
26
|
+
titleNumberColor,
|
|
27
|
+
}) => {
|
|
28
|
+
const StepDefault = () => {
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
{data!.length > 0 &&
|
|
32
|
+
data!.map((history, index) => (
|
|
33
|
+
<View testID="step-indicator" style={styles({}).containerIndicator} key={history.id}>
|
|
34
|
+
<View style={styles({ backgroundColorBall }).containerBall}>
|
|
35
|
+
{data!?.length > 1 && index < data!?.length - 1 && (
|
|
36
|
+
<View
|
|
37
|
+
style={{
|
|
38
|
+
width: 2,
|
|
39
|
+
height: 84,
|
|
40
|
+
marginTop: 116,
|
|
41
|
+
position: "relative",
|
|
42
|
+
backgroundColor: "#050022",
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
)}
|
|
46
|
+
<Text style={styles({ titleNumberColor }).titleNumber}>
|
|
47
|
+
{data!?.length - index}
|
|
48
|
+
</Text>
|
|
49
|
+
</View>
|
|
50
|
+
|
|
51
|
+
<View style={styles({}).containerMain}>
|
|
52
|
+
<Text style={styles({ titleColor }).title}>{history?.titleLabel}</Text>
|
|
53
|
+
|
|
54
|
+
{history?.data_inicio && (
|
|
55
|
+
<Text style={styles({ textColorDescription }).titleDescription}>
|
|
56
|
+
{`Inicio: ${history.data_inicio} ás ${history.data_fim}`}
|
|
57
|
+
</Text>
|
|
58
|
+
)}
|
|
59
|
+
|
|
60
|
+
{history.description && (
|
|
61
|
+
<Text style={styles({ textColorDescription }).titleDescription}>
|
|
62
|
+
Duração: {history?.description}
|
|
63
|
+
</Text>
|
|
64
|
+
)}
|
|
65
|
+
</View>
|
|
66
|
+
</View>
|
|
67
|
+
))}
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const StepCustom = () => {
|
|
73
|
+
return (
|
|
74
|
+
<View
|
|
75
|
+
style={{
|
|
76
|
+
width: "100%",
|
|
77
|
+
height: 84,
|
|
78
|
+
paddingHorizontal: 24,
|
|
79
|
+
display: "flex",
|
|
80
|
+
flexDirection: "row",
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
{data.map((step, indexCustom) => {
|
|
84
|
+
const titleLabel = getIconKeyByValue(step.titleLabel);
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
<View
|
|
89
|
+
key={String(Math.random() * 10)}
|
|
90
|
+
style={{
|
|
91
|
+
width: 45,
|
|
92
|
+
height: 45,
|
|
93
|
+
backgroundColor: indexCustom <= 3 ? "orange" : "transparent",
|
|
94
|
+
borderRadius: 50,
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
justifyContent: "center",
|
|
97
|
+
borderWidth: 1,
|
|
98
|
+
borderColor: "#fff",
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
<View
|
|
102
|
+
style={{
|
|
103
|
+
width: 45,
|
|
104
|
+
height: 45,
|
|
105
|
+
backgroundColor: "transparent",
|
|
106
|
+
borderRadius: 50,
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
justifyContent: "center",
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
{titleLabel && <Icons icon={titleLabel} />}
|
|
112
|
+
</View>
|
|
113
|
+
<Text
|
|
114
|
+
style={{
|
|
115
|
+
position: "absolute",
|
|
116
|
+
top: 56,
|
|
117
|
+
fontWeight: "600",
|
|
118
|
+
fontSize: 10,
|
|
119
|
+
lineHeight: 14,
|
|
120
|
+
textAlign: "center",
|
|
121
|
+
color: "#fff",
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
{step.titleLabel}
|
|
125
|
+
</Text>
|
|
126
|
+
</View>
|
|
127
|
+
|
|
128
|
+
{data!?.length > 1 && indexCustom < data!?.length - 1 && (
|
|
129
|
+
<View
|
|
130
|
+
key={indexCustom}
|
|
131
|
+
style={{
|
|
132
|
+
width: 90,
|
|
133
|
+
height: 2,
|
|
134
|
+
marginTop: 24,
|
|
135
|
+
position: "relative",
|
|
136
|
+
backgroundColor: "orange",
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
)}
|
|
140
|
+
</>
|
|
141
|
+
);
|
|
142
|
+
})}
|
|
143
|
+
</View>
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const handleRenderComponent = (stepType: "default" | "custom") => {
|
|
148
|
+
switch (stepType) {
|
|
149
|
+
case "default":
|
|
150
|
+
return <StepDefault />;
|
|
151
|
+
case "custom":
|
|
152
|
+
return <StepCustom />;
|
|
153
|
+
default:
|
|
154
|
+
return <View />;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return <>{handleRenderComponent(type!)}</>;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* EXPORTS
|
|
163
|
+
*/
|
|
164
|
+
export { StepIndicator };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
type IData = {
|
|
6
|
+
id: number;
|
|
7
|
+
titleLabel: string;
|
|
8
|
+
data_inicio: string;
|
|
9
|
+
data_fim: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
interface IStepIndicator {
|
|
13
|
+
/**dados que vão ser renderizados */
|
|
14
|
+
data?: IData[];
|
|
15
|
+
|
|
16
|
+
/**tupo de renderização padrão ou customizada */
|
|
17
|
+
type?: "default" | "custom";
|
|
18
|
+
|
|
19
|
+
/**tamanho do step indicator */
|
|
20
|
+
backgroundColorBall?: string;
|
|
21
|
+
|
|
22
|
+
/**cor do texto */
|
|
23
|
+
titleColor?: string;
|
|
24
|
+
|
|
25
|
+
/**cor do numero do step indicator */
|
|
26
|
+
titleNumberColor?: string;
|
|
27
|
+
|
|
28
|
+
/**cor do texto da descrição */
|
|
29
|
+
textColorDescription?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* EXPORTS
|
|
33
|
+
*/
|
|
34
|
+
export { type IStepIndicator };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { StyleSheet } from "react-native";
|
|
6
|
+
|
|
7
|
+
// typings
|
|
8
|
+
import { IStepIndicator } from "./interface";
|
|
9
|
+
|
|
10
|
+
// styles
|
|
11
|
+
import { theme } from "../../styles/theme/theme";
|
|
12
|
+
|
|
13
|
+
const styles = (props: IStepIndicator) =>
|
|
14
|
+
StyleSheet.create({
|
|
15
|
+
containerIndicator: {
|
|
16
|
+
width: "100%",
|
|
17
|
+
height: 86,
|
|
18
|
+
flexDirection: "row",
|
|
19
|
+
justifyContent: "flex-start",
|
|
20
|
+
// backgroundColor: theme.colors.gray[300],
|
|
21
|
+
},
|
|
22
|
+
containerBall: {
|
|
23
|
+
width: 32,
|
|
24
|
+
height: 32,
|
|
25
|
+
backgroundColor: props.backgroundColorBall ?? theme.colors.blue[500],
|
|
26
|
+
flexDirection: "row",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
borderRadius: 16,
|
|
30
|
+
},
|
|
31
|
+
title: {
|
|
32
|
+
color: props.titleColor ?? "black",
|
|
33
|
+
textAlign: "center",
|
|
34
|
+
lineHeight: 24,
|
|
35
|
+
fontSize: theme.fontSizes["sm"],
|
|
36
|
+
fontWeight: "500",
|
|
37
|
+
marginLeft: 8,
|
|
38
|
+
},
|
|
39
|
+
titleNumber: {
|
|
40
|
+
color: props.titleNumberColor ?? theme.colors.neutral[25],
|
|
41
|
+
textAlign: "center",
|
|
42
|
+
lineHeight: 18,
|
|
43
|
+
fontFamily: theme.fonts.inter_regular_400,
|
|
44
|
+
fontSize: theme.fontSizes["xs"],
|
|
45
|
+
position: "absolute",
|
|
46
|
+
},
|
|
47
|
+
titleDescription: {
|
|
48
|
+
color: props.textColorDescription ?? theme.colors.gray[700],
|
|
49
|
+
textAlign: "center",
|
|
50
|
+
lineHeight: 16,
|
|
51
|
+
fontSize: 12,
|
|
52
|
+
fontFamily: theme.fonts.inter_light_300,
|
|
53
|
+
marginLeft: 8,
|
|
54
|
+
},
|
|
55
|
+
containerMain: {
|
|
56
|
+
width: "100%",
|
|
57
|
+
height: 56,
|
|
58
|
+
flexDirection: "column",
|
|
59
|
+
alignItems: "flex-start",
|
|
60
|
+
marginLeft: 2,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* EXPORTS
|
|
66
|
+
*/
|
|
67
|
+
export { styles };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Text } from "react-native";
|
|
6
|
+
|
|
7
|
+
// typings
|
|
8
|
+
import { ITextInterface } from "./interface";
|
|
9
|
+
|
|
10
|
+
//styles
|
|
11
|
+
import { styles } from "./styles";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Componente Typography para a interação da ui.
|
|
15
|
+
*/
|
|
16
|
+
const Typography: React.FC<ITextInterface> = ({
|
|
17
|
+
text = "Hello Dev",
|
|
18
|
+
color = "#1E1E1E",
|
|
19
|
+
size = 23,
|
|
20
|
+
lineHeight = 24,
|
|
21
|
+
align = "left",
|
|
22
|
+
textDecoration,
|
|
23
|
+
fontWeight = "300",
|
|
24
|
+
fontFamily,
|
|
25
|
+
margin,
|
|
26
|
+
marginLeft,
|
|
27
|
+
marginRight,
|
|
28
|
+
marginTop,
|
|
29
|
+
marginBottom,
|
|
30
|
+
padding,
|
|
31
|
+
paddingLeft,
|
|
32
|
+
paddingRight,
|
|
33
|
+
paddingTop,
|
|
34
|
+
paddingBottom,
|
|
35
|
+
numberOfLines,
|
|
36
|
+
ellipsizeMode,
|
|
37
|
+
}) => {
|
|
38
|
+
const data = {
|
|
39
|
+
color,
|
|
40
|
+
size,
|
|
41
|
+
lineHeight,
|
|
42
|
+
align,
|
|
43
|
+
textDecoration,
|
|
44
|
+
fontWeight,
|
|
45
|
+
fontFamily,
|
|
46
|
+
margin,
|
|
47
|
+
marginLeft,
|
|
48
|
+
marginRight,
|
|
49
|
+
marginTop,
|
|
50
|
+
marginBottom,
|
|
51
|
+
padding,
|
|
52
|
+
paddingLeft,
|
|
53
|
+
paddingRight,
|
|
54
|
+
paddingTop,
|
|
55
|
+
paddingBottom,
|
|
56
|
+
} as ITextInterface;
|
|
57
|
+
return (
|
|
58
|
+
<Text numberOfLines={numberOfLines} ellipsizeMode={ellipsizeMode} style={styles(data).text}>
|
|
59
|
+
{text}
|
|
60
|
+
</Text>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* EXPORT
|
|
66
|
+
*/
|
|
67
|
+
export { Typography };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import { TextProps } from "react-native";
|
|
5
|
+
|
|
6
|
+
import { theme } from "../../styles/theme/theme";
|
|
7
|
+
|
|
8
|
+
interface ITextInterface extends TextProps {
|
|
9
|
+
/**
|
|
10
|
+
* Propiedade texto que serar renderizado pro usuário final
|
|
11
|
+
*/
|
|
12
|
+
text: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A propriedade CSS color define o valor da cor de primeiro plano do texto e das decorações de texto de um elemento e define o valor currentcolor. currentcolor pode ser usado como um valor indireto em outras propriedades e é o padrão para outras propriedades de cores, como border-color.
|
|
16
|
+
*/
|
|
17
|
+
color?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Propiedade size define o tamanho e a orientação da caixa que é usada para representar uma página. Na maioria das vezes, esse tamanho corresponde ao tamanho alvo da página impressa, se aplicável.
|
|
21
|
+
*/
|
|
22
|
+
size?: number;
|
|
23
|
+
|
|
24
|
+
align?: "center" | "left" | "right";
|
|
25
|
+
lineHeight?: number;
|
|
26
|
+
letterSpacing?: keyof typeof theme.letterSpacing;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A propriedade text-decoration do CSS é usada para definir a formatação de underline, overline, line-through ou blink. As decorações underline e overline são posicionadas abaixo e acima do texto (respectivamente), e line-through cortando-o.
|
|
30
|
+
*/
|
|
31
|
+
textDecoration?: "line-through" | "underline" | "none";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A propriedade CSS font-weight define o peso (ou negrito) da fonte. Os pesos disponíveis dependem da família de fontes definida atualmente.
|
|
35
|
+
*/
|
|
36
|
+
fontWeight?: "100" | "300" | "400" | "500" | "600" | "700";
|
|
37
|
+
|
|
38
|
+
// fontFamily?: keyof typeof theme.fonts;
|
|
39
|
+
fontFamily?: string | undefined;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A propriedade margin do CSS define a área de margem nos quatro lados do elemento. É uma abreviação que define todas as margens individuais de uma só vez: margin-top, margin-right (en-US), margin-bottom, e margin-left (en-US).
|
|
43
|
+
*/
|
|
44
|
+
margin?: number;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A propriedade CSS define a área de margem no lado esquerdo de um elemento. Um valor positivo o coloca mais distante de seus vizinhos, enquanto um valor negativo o coloca mais próximo.margin-left
|
|
48
|
+
*/
|
|
49
|
+
marginLeft?: number;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A propriedade CSS define a área de margem no lado direito de um elemento. Um valor positivo o coloca mais distante de seus vizinhos, enquanto um valor negativo o coloca mais próximo.margin-right
|
|
53
|
+
*/
|
|
54
|
+
marginRight?: number;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A propriedade CSS margin-top de um elemento indica o espaço acima do elemento. Valores negativos são aceitos.
|
|
58
|
+
*/
|
|
59
|
+
marginTop?: number;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A propriedade CSS margin-bottom define a margin area na parte inferior de um elemento. Um valor positivo coloca o valor mais longe de outros elementos vizinhos, enquanto um valor negativo, aproxima.
|
|
63
|
+
*/
|
|
64
|
+
marginBottom?: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A propriedade padding define uma a distância entre o conteúdo de um elemento e suas bordas. É um atalho que evita definir uma distância para cada lado separadamente (padding-top, padding-right, padding-bottom, padding-left).
|
|
68
|
+
*/
|
|
69
|
+
padding?: number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* A propriedade CSS padding-left é um elemento que define o espaço de preenchimento obrigatório no lado esquerdo de um elemento. padding area é o espaço entre o conteúdo do elemento e a borda. Um valor negativo não é permitido.
|
|
73
|
+
*/
|
|
74
|
+
paddingLeft?: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A propriedade CSS define a largura da área de preenchimento à direita de um elemento.padding-right
|
|
78
|
+
*/
|
|
79
|
+
paddingRight?: number;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A propriedade CSS define a altura da área de preenchimento na parte superior de um elemento.padding-top
|
|
83
|
+
*/
|
|
84
|
+
paddingTop?: number;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* A propriedade CSS define a altura da área de preenchimento na parte inferior de um elemento.padding-bottom
|
|
88
|
+
*/
|
|
89
|
+
paddingBottom?: number;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Define o número máximo de linhas que o texto pode ocupar. Se o texto for maior que esse limite, ele será truncado. numberOfLines
|
|
93
|
+
*
|
|
94
|
+
* Define onde a elipse (...) será adicionada quando o texto for cortado devido ao numberOfLines.
|
|
95
|
+
*/
|
|
96
|
+
numberOfLines?: number;
|
|
97
|
+
ellipsizeMode?: "head" | "middle" | "tail" | "clip";
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* EXPORTS
|
|
101
|
+
*/
|
|
102
|
+
export { ITextInterface };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { StyleSheet } from "react-native";
|
|
6
|
+
import { ITextInterface } from "./interface";
|
|
7
|
+
|
|
8
|
+
const styles = (props: ITextInterface) =>
|
|
9
|
+
StyleSheet.create({
|
|
10
|
+
text: {
|
|
11
|
+
textAlign: props?.align,
|
|
12
|
+
fontSize: props?.size ?? 20,
|
|
13
|
+
fontWeight: props?.fontWeight,
|
|
14
|
+
fontFamily: props.fontFamily ?? "Inter-Medium",
|
|
15
|
+
color: props?.color,
|
|
16
|
+
lineHeight: props?.lineHeight,
|
|
17
|
+
letterSpacing: 0.5,
|
|
18
|
+
margin: props?.margin,
|
|
19
|
+
marginLeft: props?.marginLeft ?? 0,
|
|
20
|
+
marginRight: props?.marginRight ?? 0,
|
|
21
|
+
marginTop: props?.marginTop ?? 0,
|
|
22
|
+
marginBottom: props?.marginBottom ?? 0,
|
|
23
|
+
padding: props?.padding ?? 0,
|
|
24
|
+
paddingLeft: props?.paddingLeft ?? 0,
|
|
25
|
+
paddingRight: props?.paddingRight ?? 0,
|
|
26
|
+
paddingTop: props?.paddingTop ?? 0,
|
|
27
|
+
paddingBottom: props?.paddingBottom ?? 0,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* EXPORTS
|
|
33
|
+
*/
|
|
34
|
+
export { styles };
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Components
|
|
6
|
+
export { Box } from "./components/box";
|
|
7
|
+
export { Button } from "./components/button";
|
|
8
|
+
export { StepIndicator } from "./components/step-indicator";
|
|
9
|
+
export { Typography } from "./components/typography";
|
|
10
|
+
export { Input } from "./components/input";
|
|
11
|
+
export { CapturePhoto } from "./components/capture-photo";
|
|
12
|
+
export { CardHours } from "./components/card-hours";
|
|
13
|
+
export { SelectOption } from "./components/selects/select-option";
|
|
14
|
+
export { Header } from "./components/header-profile";
|
|
15
|
+
export { ScheduledJourneyIndicators } from "./components/scheduled-journey-indicators";
|
|
16
|
+
export { CardScheduledJourney } from "./components/card-scheduled-journey";
|
|
17
|
+
|
|
18
|
+
// Utilities
|
|
19
|
+
export { multiply } from "./utils/mutiply";
|
|
20
|
+
export { formatDate } from "./utils/format-data";
|
|
21
|
+
|
|
22
|
+
// Styles
|
|
23
|
+
export { theme } from "./styles/theme/theme";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
// components
|
|
6
|
+
import { Box } from "../../components/box";
|
|
7
|
+
import { Typography } from "../../components/typography";
|
|
8
|
+
|
|
9
|
+
// styles
|
|
10
|
+
import { theme } from "../../styles/theme/theme";
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof Box> = {
|
|
13
|
+
title: "Componente/Box",
|
|
14
|
+
component: Box,
|
|
15
|
+
args: {
|
|
16
|
+
width: "100%",
|
|
17
|
+
height: "05%",
|
|
18
|
+
},
|
|
19
|
+
parameters: {
|
|
20
|
+
notes: `
|
|
21
|
+
# Box
|
|
22
|
+
|
|
23
|
+
Este é um componente de box.
|
|
24
|
+
Você usa assim:
|
|
25
|
+
\`\`\`tsx
|
|
26
|
+
<Box
|
|
27
|
+
width={100}
|
|
28
|
+
height={80}
|
|
29
|
+
borderStyled={{
|
|
30
|
+
borderWidth: 1,
|
|
31
|
+
borderRadius: 8,
|
|
32
|
+
borderStyle: 'solid',
|
|
33
|
+
borderColor: '#050022',
|
|
34
|
+
}}
|
|
35
|
+
/>
|
|
36
|
+
\`\`\`
|
|
37
|
+
`,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
44
|
+
|
|
45
|
+
export const BoxSolid: Story = {
|
|
46
|
+
name: "box-solid",
|
|
47
|
+
args: {
|
|
48
|
+
width: "100%",
|
|
49
|
+
height: 100,
|
|
50
|
+
backgroundColor: "transparent",
|
|
51
|
+
borderStyled: {
|
|
52
|
+
borderWidth: 1,
|
|
53
|
+
borderRadius: 8,
|
|
54
|
+
borderStyle: "solid",
|
|
55
|
+
borderColor: theme.colors.gray[300],
|
|
56
|
+
},
|
|
57
|
+
flexStyle: {
|
|
58
|
+
flexDirection: "row",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center",
|
|
61
|
+
},
|
|
62
|
+
children: <Typography text="Olá Dev" color={theme.colors.neutral[25]} />,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const BoxDashed: Story = {
|
|
67
|
+
name: "box-dashed",
|
|
68
|
+
args: {
|
|
69
|
+
width: "100%",
|
|
70
|
+
height: 100,
|
|
71
|
+
backgroundColor: "transparent",
|
|
72
|
+
borderStyled: {
|
|
73
|
+
borderWidth: 1,
|
|
74
|
+
borderRadius: 8,
|
|
75
|
+
borderStyle: "dashed",
|
|
76
|
+
borderColor: theme.colors.gray[300],
|
|
77
|
+
},
|
|
78
|
+
flexStyle: {
|
|
79
|
+
flexDirection: "row",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
},
|
|
83
|
+
children: <Typography text="Olá Dev" color={theme.colors.neutral[25]} />,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const BoxDotted: Story = {
|
|
88
|
+
name: "box-dotted",
|
|
89
|
+
args: {
|
|
90
|
+
width: "100%",
|
|
91
|
+
height: 100,
|
|
92
|
+
backgroundColor: "transparent",
|
|
93
|
+
borderStyled: {
|
|
94
|
+
borderWidth: 1,
|
|
95
|
+
borderRadius: 8,
|
|
96
|
+
borderStyle: "dotted",
|
|
97
|
+
borderColor: theme.colors.gray[300],
|
|
98
|
+
},
|
|
99
|
+
flexStyle: {
|
|
100
|
+
flexDirection: "row",
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
justifyContent: "center",
|
|
103
|
+
},
|
|
104
|
+
children: <Typography text="Olá Dev" color={theme.colors.neutral[25]} />,
|
|
105
|
+
},
|
|
106
|
+
};
|