react-native-exp-fig 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/common/icons-svg/index.js +2 -1
- package/lib/commonjs/common/icons-svg/index.js.map +1 -1
- package/lib/commonjs/components/activities-daily/index.js +6 -5
- package/lib/commonjs/components/activities-daily/index.js.map +1 -1
- package/lib/commonjs/components/activities-progress/index.js +5 -4
- package/lib/commonjs/components/activities-progress/index.js.map +1 -1
- package/lib/commonjs/components/activities-progress/interface.d.js.map +1 -1
- package/lib/commonjs/components/loading-details/index.js +13 -11
- package/lib/commonjs/components/loading-details/index.js.map +1 -1
- package/lib/commonjs/components/loading-details/interface.d.js.map +1 -1
- package/lib/commonjs/components/notification-loading/index.js +5 -6
- package/lib/commonjs/components/notification-loading/index.js.map +1 -1
- package/lib/commonjs/components/step-indicator/index.js +9 -9
- package/lib/commonjs/components/step-indicator/index.js.map +1 -1
- package/lib/commonjs/components/step-indicator/interface.d.js.map +1 -1
- package/lib/commonjs/components/step-indicator/styles.js +6 -6
- package/lib/commonjs/components/step-indicator/styles.js.map +1 -1
- package/lib/commonjs/stories/activities-progress/activities-progress.stories.js +4 -4
- package/lib/commonjs/stories/activities-progress/activities-progress.stories.js.map +1 -1
- package/lib/commonjs/stories/loading-details/loading-details.stories.js +14 -2
- package/lib/commonjs/stories/loading-details/loading-details.stories.js.map +1 -1
- package/lib/commonjs/stories/step-indicator/step-indicator.stories.js +34 -7
- package/lib/commonjs/stories/step-indicator/step-indicator.stories.js.map +1 -1
- package/lib/commonjs/styles/theme/theme.js +5 -4
- package/lib/commonjs/styles/theme/theme.js.map +1 -1
- package/lib/commonjs/utils/get-icon-by-property/index.js +4 -2
- package/lib/commonjs/utils/get-icon-by-property/index.js.map +1 -1
- package/lib/module/common/icons-svg/index.js +2 -1
- package/lib/module/common/icons-svg/index.js.map +1 -1
- package/lib/module/components/activities-daily/index.js +6 -5
- package/lib/module/components/activities-daily/index.js.map +1 -1
- package/lib/module/components/activities-progress/index.js +5 -4
- package/lib/module/components/activities-progress/index.js.map +1 -1
- package/lib/module/components/activities-progress/interface.d.js.map +1 -1
- package/lib/module/components/loading-details/index.js +13 -11
- package/lib/module/components/loading-details/index.js.map +1 -1
- package/lib/module/components/loading-details/interface.d.js.map +1 -1
- package/lib/module/components/notification-loading/index.js +5 -6
- package/lib/module/components/notification-loading/index.js.map +1 -1
- package/lib/module/components/step-indicator/index.js +9 -9
- package/lib/module/components/step-indicator/index.js.map +1 -1
- package/lib/module/components/step-indicator/interface.d.js.map +1 -1
- package/lib/module/components/step-indicator/styles.js +6 -6
- package/lib/module/components/step-indicator/styles.js.map +1 -1
- package/lib/module/stories/activities-progress/activities-progress.stories.js +4 -4
- package/lib/module/stories/activities-progress/activities-progress.stories.js.map +1 -1
- package/lib/module/stories/loading-details/loading-details.stories.js +13 -1
- package/lib/module/stories/loading-details/loading-details.stories.js.map +1 -1
- package/lib/module/stories/step-indicator/step-indicator.stories.js +33 -6
- package/lib/module/stories/step-indicator/step-indicator.stories.js.map +1 -1
- package/lib/module/styles/theme/theme.js +5 -4
- package/lib/module/styles/theme/theme.js.map +1 -1
- package/lib/module/utils/get-icon-by-property/index.js +4 -2
- package/lib/module/utils/get-icon-by-property/index.js.map +1 -1
- package/lib/typescript/src/stories/loading-details/loading-details.stories.d.ts +1 -0
- package/lib/typescript/src/stories/step-indicator/step-indicator.stories.d.ts +1 -0
- package/lib/typescript/src/styles/global/theme-provider.d.ts +1 -0
- package/lib/typescript/src/styles/theme/theme.d.ts +1 -0
- package/package.json +1 -1
- package/src/common/icons-svg/index.tsx +1 -1
- package/src/components/activities-daily/index.tsx +116 -116
- package/src/components/activities-progress/index.tsx +5 -4
- package/src/components/activities-progress/interface.d.ts +2 -2
- package/src/components/loading-details/index.tsx +156 -154
- package/src/components/loading-details/interface.d.ts +31 -28
- package/src/components/notification-loading/index.tsx +157 -162
- package/src/components/step-indicator/index.tsx +166 -164
- package/src/components/step-indicator/interface.d.ts +35 -34
- package/src/components/step-indicator/styles.ts +68 -68
- package/src/stories/activities-progress/activities-progress.stories.tsx +4 -4
- package/src/stories/loading-details/loading-details.stories.tsx +60 -48
- package/src/stories/step-indicator/step-indicator.stories.tsx +154 -124
- package/src/styles/theme/theme.ts +172 -171
- package/src/utils/get-icon-by-property/index.tsx +2 -1
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
type IData = {
|
|
6
|
-
id: number;
|
|
7
|
-
duracao_segundos: string | number;
|
|
8
|
-
data_inicio: string;
|
|
9
|
-
data_fim: string;
|
|
10
|
-
descricao: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
type IData = {
|
|
6
|
+
id: number;
|
|
7
|
+
duracao_segundos: string | number;
|
|
8
|
+
data_inicio: string;
|
|
9
|
+
data_fim: string;
|
|
10
|
+
descricao: string;
|
|
11
|
+
sincronizado;
|
|
12
|
+
};
|
|
13
|
+
interface IStepIndicator {
|
|
14
|
+
/**dados que vão ser renderizados */
|
|
15
|
+
data?: IData[];
|
|
16
|
+
|
|
17
|
+
/**tupo de renderização padrão ou customizada */
|
|
18
|
+
type?: "default" | "custom";
|
|
19
|
+
|
|
20
|
+
/**cor do texto */
|
|
21
|
+
titleColor?: string;
|
|
22
|
+
|
|
23
|
+
/**cor do numero do step indicator */
|
|
24
|
+
titleNumberColor?: string;
|
|
25
|
+
|
|
26
|
+
/**cor do texto da descrição */
|
|
27
|
+
textColorDescription?: string;
|
|
28
|
+
|
|
29
|
+
/**verifica se foi sincronizado com back end */
|
|
30
|
+
sincronizado?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* EXPORTS
|
|
34
|
+
*/
|
|
35
|
+
export { type IStepIndicator };
|
|
@@ -1,68 +1,68 @@
|
|
|
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.
|
|
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: 20,
|
|
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: 16,
|
|
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: theme.fontSizes["xs"],
|
|
52
|
-
fontFamily: theme.fonts.inter_regular_400,
|
|
53
|
-
fontWeight: "400",
|
|
54
|
-
marginLeft: 8,
|
|
55
|
-
},
|
|
56
|
-
containerMain: {
|
|
57
|
-
width: "100%",
|
|
58
|
-
height: 56,
|
|
59
|
-
flexDirection: "column",
|
|
60
|
-
alignItems: "flex-start",
|
|
61
|
-
marginLeft: 2,
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* EXPORTS
|
|
67
|
-
*/
|
|
68
|
-
export { styles };
|
|
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.sincronizado ? theme.colors.blue[500] : theme.colors.orange[150],
|
|
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: 20,
|
|
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: 16,
|
|
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: theme.fontSizes["xs"],
|
|
52
|
+
fontFamily: theme.fonts.inter_regular_400,
|
|
53
|
+
fontWeight: "400",
|
|
54
|
+
marginLeft: 8,
|
|
55
|
+
},
|
|
56
|
+
containerMain: {
|
|
57
|
+
width: "100%",
|
|
58
|
+
height: 56,
|
|
59
|
+
flexDirection: "column",
|
|
60
|
+
alignItems: "flex-start",
|
|
61
|
+
marginLeft: 2,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* EXPORTS
|
|
67
|
+
*/
|
|
68
|
+
export { styles };
|
|
@@ -11,7 +11,7 @@ const meta: Meta<typeof ActivitiesProgress> = {
|
|
|
11
11
|
data_inicio_horario: "17:20",
|
|
12
12
|
tipo_atividade: "trabalho",
|
|
13
13
|
titleLabel: "Operação com Veículo",
|
|
14
|
-
|
|
14
|
+
criado_offline: true,
|
|
15
15
|
referencia: "repouso_semanal",
|
|
16
16
|
},
|
|
17
17
|
parameters: {
|
|
@@ -27,7 +27,7 @@ Você usa assim:
|
|
|
27
27
|
data_inicio_horario="17:20"
|
|
28
28
|
tipo_atividade="descanso"
|
|
29
29
|
titleLabel="Repouso Noturno"
|
|
30
|
-
|
|
30
|
+
criado_offline=true
|
|
31
31
|
referencia="repouso_semanal"
|
|
32
32
|
/>
|
|
33
33
|
\`\`\`
|
|
@@ -52,7 +52,7 @@ export const ActivitiesProgressTrabalho: Story = {
|
|
|
52
52
|
data_inicio_horario: "14:30",
|
|
53
53
|
titleLabel: "Em Carga",
|
|
54
54
|
tipo_atividade: "trabalho",
|
|
55
|
-
|
|
55
|
+
criado_offline: true,
|
|
56
56
|
referencia: "operacao_veiculo",
|
|
57
57
|
},
|
|
58
58
|
};
|
|
@@ -65,7 +65,7 @@ export const ActivitiesProgressDescanso: Story = {
|
|
|
65
65
|
data_inicio_horario: "12:00",
|
|
66
66
|
titleLabel: "Refeição",
|
|
67
67
|
tipo_atividade: "descanso",
|
|
68
|
-
|
|
68
|
+
criado_offline: false,
|
|
69
69
|
referencia: "refeicao",
|
|
70
70
|
},
|
|
71
71
|
};
|
|
@@ -1,48 +1,60 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { StoryObj, Meta } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
import { LoadingDetails } from "../../components/loading-details";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof LoadingDetails> = {
|
|
7
|
-
title: "componente/LoadingDetails",
|
|
8
|
-
component: LoadingDetails as React.FC,
|
|
9
|
-
args: {
|
|
10
|
-
numero: "01",
|
|
11
|
-
local: "Doca 1, Pátio 02 - Ultrimais (Ipatinga)",
|
|
12
|
-
date: "24/03/2025",
|
|
13
|
-
duracao: "00:00",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import { LoadingDetails } from "../../components/loading-details";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof LoadingDetails> = {
|
|
7
|
+
title: "componente/LoadingDetails",
|
|
8
|
+
component: LoadingDetails as React.FC,
|
|
9
|
+
args: {
|
|
10
|
+
numero: "01",
|
|
11
|
+
local: "Doca 1, Pátio 02 - Ultrimais (Ipatinga)",
|
|
12
|
+
date: "24/03/2025",
|
|
13
|
+
duracao: "00:00",
|
|
14
|
+
disabled: false,
|
|
15
|
+
},
|
|
16
|
+
parameters: {
|
|
17
|
+
notes: `
|
|
18
|
+
# LoadingDetails
|
|
19
|
+
|
|
20
|
+
Este é um componente de LoadingDetails.
|
|
21
|
+
Você usa assim:
|
|
22
|
+
\`\`\`tsx
|
|
23
|
+
<LoadingDetails
|
|
24
|
+
numero="01"
|
|
25
|
+
local="Doca 1, Pátio 02 - Usiminas (Ipatinga)"
|
|
26
|
+
date="24/03/2025"
|
|
27
|
+
duracao="00:00"
|
|
28
|
+
handleClickGoback={() => {}}
|
|
29
|
+
isLoadingStart={false}
|
|
30
|
+
handleClickStart={() => {}}
|
|
31
|
+
disabled={true}
|
|
32
|
+
/>
|
|
33
|
+
\`\`\`
|
|
34
|
+
`,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
type Story = StoryObj<typeof meta>;
|
|
41
|
+
|
|
42
|
+
export const Profile: Story = {
|
|
43
|
+
name: "loading-details",
|
|
44
|
+
args: {
|
|
45
|
+
numero: "01",
|
|
46
|
+
local: "Doca 1, Pátio 02 - Ultrimais (Ipatinga)",
|
|
47
|
+
date: "24/03/2025",
|
|
48
|
+
duracao: "00:00",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
export const ProfileDisabled: Story = {
|
|
52
|
+
name: "loading-details-disabled",
|
|
53
|
+
args: {
|
|
54
|
+
numero: "01",
|
|
55
|
+
local: "Doca 1, Pátio 02 - Ultrimais (Ipatinga)",
|
|
56
|
+
date: "24/03/2025",
|
|
57
|
+
duracao: "00:00",
|
|
58
|
+
disabled: true,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -1,124 +1,154 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
|
|
3
|
-
// components
|
|
4
|
-
import { StepIndicator } from "../../components/step-indicator";
|
|
5
|
-
|
|
6
|
-
// styles
|
|
7
|
-
import { theme } from "../../styles/theme/theme";
|
|
8
|
-
|
|
9
|
-
const meta: Meta<typeof StepIndicator> = {
|
|
10
|
-
title: "Componente/StepIndicator",
|
|
11
|
-
component: StepIndicator,
|
|
12
|
-
args: {
|
|
13
|
-
data: [
|
|
14
|
-
{
|
|
15
|
-
id: 1,
|
|
16
|
-
descricao: "Repouso Noturno",
|
|
17
|
-
data_inicio: "07/03/2024 14:52",
|
|
18
|
-
data_fim: "07/03/2024 17:52",
|
|
19
|
-
duracao_segundos: "3601",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
titleColor: theme.colors.neutral[25],
|
|
24
|
-
titleNumberColor: theme.colors.neutral[25],
|
|
25
|
-
},
|
|
26
|
-
parameters: {
|
|
27
|
-
notes: `
|
|
28
|
-
# StepIndicator
|
|
29
|
-
|
|
30
|
-
Este é um componente de step indicator.
|
|
31
|
-
Você usa assim:
|
|
32
|
-
\`\`\`tsx
|
|
33
|
-
<StepIndicator
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 2,
|
|
57
|
-
descricao: "Descarga",
|
|
58
|
-
data_inicio: "06/03/2024 14:52",
|
|
59
|
-
data_fim: "06/03/2024 16:52",
|
|
60
|
-
duracao_segundos: "7200",
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
{
|
|
66
|
-
id: 1,
|
|
67
|
-
descricao: "
|
|
68
|
-
data_inicio: "",
|
|
69
|
-
data_fim: "",
|
|
70
|
-
duracao_segundos: "",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
// components
|
|
4
|
+
import { StepIndicator } from "../../components/step-indicator";
|
|
5
|
+
|
|
6
|
+
// styles
|
|
7
|
+
import { theme } from "../../styles/theme/theme";
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof StepIndicator> = {
|
|
10
|
+
title: "Componente/StepIndicator",
|
|
11
|
+
component: StepIndicator,
|
|
12
|
+
args: {
|
|
13
|
+
data: [
|
|
14
|
+
{
|
|
15
|
+
id: 1,
|
|
16
|
+
descricao: "Repouso Noturno",
|
|
17
|
+
data_inicio: "07/03/2024 14:52",
|
|
18
|
+
data_fim: "07/03/2024 17:52",
|
|
19
|
+
duracao_segundos: "3601",
|
|
20
|
+
sincronizado: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
titleColor: theme.colors.neutral[25],
|
|
24
|
+
titleNumberColor: theme.colors.neutral[25],
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
notes: `
|
|
28
|
+
# StepIndicator
|
|
29
|
+
|
|
30
|
+
Este é um componente de step indicator.
|
|
31
|
+
Você usa assim:
|
|
32
|
+
\`\`\`tsx
|
|
33
|
+
<StepIndicator
|
|
34
|
+
type="default"
|
|
35
|
+
data={dataMock}
|
|
36
|
+
/>
|
|
37
|
+
\`\`\`
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
|
|
44
|
+
type Story = StoryObj<typeof meta>;
|
|
45
|
+
|
|
46
|
+
const dataMock = [
|
|
47
|
+
{
|
|
48
|
+
id: 1,
|
|
49
|
+
descricao: "Repouso Noturno",
|
|
50
|
+
data_inicio: "07/03/2024 14:52",
|
|
51
|
+
data_fim: "07/03/2024 17:52",
|
|
52
|
+
duracao_segundos: "3601",
|
|
53
|
+
sincronizado: true,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 2,
|
|
57
|
+
descricao: "Descarga",
|
|
58
|
+
data_inicio: "06/03/2024 14:52",
|
|
59
|
+
data_fim: "06/03/2024 16:52",
|
|
60
|
+
duracao_segundos: "7200",
|
|
61
|
+
sincronizado: true,
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
const dataMockFalse = [
|
|
65
|
+
{
|
|
66
|
+
id: 1,
|
|
67
|
+
descricao: "Repouso Noturno",
|
|
68
|
+
data_inicio: "07/03/2024 14:52",
|
|
69
|
+
data_fim: "07/03/2024 17:52",
|
|
70
|
+
duracao_segundos: "3601",
|
|
71
|
+
sincronizado: false,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 2,
|
|
75
|
+
descricao: "Descarga",
|
|
76
|
+
data_inicio: "06/03/2024 14:52",
|
|
77
|
+
data_fim: "06/03/2024 16:52",
|
|
78
|
+
duracao_segundos: "7200",
|
|
79
|
+
sincronizado: false,
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
const dataMockCustom = [
|
|
84
|
+
{
|
|
85
|
+
id: 1,
|
|
86
|
+
descricao: "Pedido Realizado",
|
|
87
|
+
data_inicio: "",
|
|
88
|
+
data_fim: "",
|
|
89
|
+
duracao_segundos: "",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 2,
|
|
93
|
+
descricao: "Pagamento Aprovado",
|
|
94
|
+
data_inicio: "07/03/2024 14:52",
|
|
95
|
+
data_fim: "07/03/2024 17:52",
|
|
96
|
+
duracao_segundos: "3601",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 3,
|
|
100
|
+
descricao: "Pedido Faturado",
|
|
101
|
+
data_inicio: "",
|
|
102
|
+
data_fim: "",
|
|
103
|
+
duracao_segundos: "",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 4,
|
|
107
|
+
descricao: "Pedido Enviado",
|
|
108
|
+
data_inicio: "",
|
|
109
|
+
data_fim: "",
|
|
110
|
+
duracao_segundos: "",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 4,
|
|
114
|
+
descricao: "Pedido Entregue",
|
|
115
|
+
data_inicio: "07/03/2024 14:52",
|
|
116
|
+
data_fim: "07/03/2024 17:52",
|
|
117
|
+
duracao_segundos: "3601",
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
export const StepIndicatorDefault: Story = {
|
|
122
|
+
name: "step-indicator-default",
|
|
123
|
+
args: {
|
|
124
|
+
data: dataMock,
|
|
125
|
+
type: "default",
|
|
126
|
+
sincronizado: true,
|
|
127
|
+
titleColor: theme.colors.neutral[25],
|
|
128
|
+
textColorDescription: theme.colors.gray[300],
|
|
129
|
+
titleNumberColor: theme.colors.neutral[25],
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
export const StepIndicatorSincronizadoFalse: Story = {
|
|
133
|
+
name: "step-indicator-sincronizado-false",
|
|
134
|
+
args: {
|
|
135
|
+
data: dataMockFalse,
|
|
136
|
+
type: "default",
|
|
137
|
+
sincronizado: false,
|
|
138
|
+
titleColor: theme.colors.neutral[25],
|
|
139
|
+
textColorDescription: theme.colors.gray[300],
|
|
140
|
+
titleNumberColor: theme.colors.neutral[25],
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const StepIndicationCustom: Story = {
|
|
145
|
+
name: "step-indicator-custom",
|
|
146
|
+
args: {
|
|
147
|
+
data: dataMockCustom,
|
|
148
|
+
type: "custom",
|
|
149
|
+
backgroundColorBall: theme.colors.orange[150],
|
|
150
|
+
titleColor: theme.colors.blue[500],
|
|
151
|
+
textColorDescription: theme.colors.gray[300],
|
|
152
|
+
titleNumberColor: theme.colors.neutral[25],
|
|
153
|
+
},
|
|
154
|
+
};
|