react-native-exp-fig 0.1.39 → 0.1.41
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/components/modal-create-activitie/index.js +8 -6
- package/lib/commonjs/components/modal-create-activitie/index.js.map +1 -1
- package/lib/commonjs/components/modal-create-activitie/interface.js.map +1 -1
- package/lib/commonjs/components/selects/select-option/index.js +8 -6
- package/lib/commonjs/components/selects/select-option/index.js.map +1 -1
- package/lib/commonjs/components/selects/select-option/interface.d.js.map +1 -1
- package/lib/commonjs/components/user-profile/index.js +2 -1
- package/lib/commonjs/components/user-profile/index.js.map +1 -1
- package/lib/commonjs/components/user-profile/interface.d.js.map +1 -1
- package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js +4 -0
- package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -1
- package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js +35 -23
- package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -1
- package/lib/module/components/modal-create-activitie/index.js +8 -6
- package/lib/module/components/modal-create-activitie/index.js.map +1 -1
- package/lib/module/components/modal-create-activitie/interface.js.map +1 -1
- package/lib/module/components/selects/select-option/index.js +8 -6
- package/lib/module/components/selects/select-option/index.js.map +1 -1
- package/lib/module/components/selects/select-option/interface.d.js.map +1 -1
- package/lib/module/components/user-profile/index.js +2 -1
- package/lib/module/components/user-profile/index.js.map +1 -1
- package/lib/module/components/user-profile/interface.d.js.map +1 -1
- package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js +4 -0
- package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -1
- package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js +35 -23
- package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -1
- package/lib/typescript/src/components/modal-create-activitie/interface.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/modal-create-activitie/index.tsx +5 -4
- package/src/components/modal-create-activitie/interface.ts +1 -0
- package/src/components/selects/select-option/index.tsx +14 -5
- package/src/components/selects/select-option/interface.d.ts +1 -0
- package/src/components/user-profile/index.tsx +32 -29
- package/src/components/user-profile/interface.d.ts +1 -0
- package/src/stories/modal-create-activitie/modal-create-activitie.stories.tsx +4 -0
- package/src/stories/modal-journey-rectification/modal-journey-rectification.stories.tsx +170 -161
|
@@ -26,6 +26,7 @@ const UserProfile: React.FC<IUserProfile> = ({
|
|
|
26
26
|
cpf,
|
|
27
27
|
placa_cavalo,
|
|
28
28
|
bluetoothIsConnected,
|
|
29
|
+
situacao = "carregador",
|
|
29
30
|
app_version,
|
|
30
31
|
color,
|
|
31
32
|
width,
|
|
@@ -133,36 +134,38 @@ const UserProfile: React.FC<IUserProfile> = ({
|
|
|
133
134
|
letterSpacing={"regular"}
|
|
134
135
|
/>
|
|
135
136
|
</Box>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
137
|
+
{situacao !== "carregador" && (
|
|
138
|
+
<Box
|
|
139
|
+
width={"100%"}
|
|
140
|
+
flexStyle={{
|
|
141
|
+
flexDirection: "row",
|
|
142
|
+
alignItems: "center",
|
|
143
|
+
justifyContent: "flex-start",
|
|
144
|
+
textAlign: "center",
|
|
145
|
+
}}
|
|
146
|
+
paddingStyle={{ paddingTop: 5 }}
|
|
147
|
+
>
|
|
148
|
+
<Typography
|
|
149
|
+
text={"CONECTADO: "}
|
|
150
|
+
color={color?.colorText ?? theme.colors.neutral[25]}
|
|
151
|
+
size={theme.fontSizes.sm}
|
|
152
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
153
|
+
fontWeight="500"
|
|
154
|
+
lineHeight={theme.fontSizes.lg ?? 18}
|
|
155
|
+
letterSpacing={"regular"}
|
|
156
|
+
/>
|
|
155
157
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
<Typography
|
|
159
|
+
text={bluetoothIsConnected ? placa_cavalo : ""}
|
|
160
|
+
color={theme.colors.green[400]}
|
|
161
|
+
size={theme.fontSizes.sm}
|
|
162
|
+
fontFamily={theme.fonts.inter_bold_700}
|
|
163
|
+
fontWeight="700"
|
|
164
|
+
lineHeight={theme.fontSizes.lg ?? 18}
|
|
165
|
+
letterSpacing={"regular"}
|
|
166
|
+
/>
|
|
167
|
+
</Box>
|
|
168
|
+
)}
|
|
166
169
|
</Box>
|
|
167
170
|
|
|
168
171
|
<Box
|
|
@@ -1,161 +1,170 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS (Storybook)
|
|
3
|
-
*/
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { View } from "react-native";
|
|
7
|
-
import { action } from "@storybook/addon-actions";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* IMPORTS (Componente)
|
|
11
|
-
* Ajuste o caminho conforme sua estrutura (ex.: "../index" ou "./index").
|
|
12
|
-
*/
|
|
13
|
-
import ModalJourneyRectification from "../../components/modal-create-activitie";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* DECORATORS
|
|
17
|
-
* Envolve o story para garantir área de visualização e evitar "modal perdido".
|
|
18
|
-
*/
|
|
19
|
-
const WithViewport: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|
20
|
-
return (
|
|
21
|
-
<View
|
|
22
|
-
style={{
|
|
23
|
-
flex: 1,
|
|
24
|
-
minHeight: 600,
|
|
25
|
-
alignItems: "center",
|
|
26
|
-
justifyContent: "center",
|
|
27
|
-
backgroundColor: "#F3F4F6", // neutro claro p/ destacar o modal
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
{children}
|
|
31
|
-
</View>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* META
|
|
37
|
-
*/
|
|
38
|
-
const meta: Meta<typeof ModalJourneyRectification> = {
|
|
39
|
-
title: "Componente/ModalJourneyRectification",
|
|
40
|
-
component: ModalJourneyRectification,
|
|
41
|
-
args: {
|
|
42
|
-
visible: false,
|
|
43
|
-
textTitle: "Editar atividade",
|
|
44
|
-
onClose: action("onClose")
|
|
45
|
-
onPressConfirm: action("onPressConfirm"), // idem
|
|
46
|
-
},
|
|
47
|
-
argTypes: {
|
|
48
|
-
visible: {
|
|
49
|
-
control: { type: "boolean" },
|
|
50
|
-
description: "Define a visibilidade do modal.",
|
|
51
|
-
table: { category: "Controle" },
|
|
52
|
-
},
|
|
53
|
-
textTitle: {
|
|
54
|
-
control: { type: "text" },
|
|
55
|
-
description: "Título exibido no cabeçalho do modal.",
|
|
56
|
-
table: { category: "Conteúdo" },
|
|
57
|
-
},
|
|
58
|
-
onClose: {
|
|
59
|
-
description: "Callback ao cancelar/fechar o modal.",
|
|
60
|
-
table: { category: "Eventos" },
|
|
61
|
-
},
|
|
62
|
-
onPressConfirm: {
|
|
63
|
-
description:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS (Storybook)
|
|
3
|
+
*/
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { action } from "@storybook/addon-actions";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* IMPORTS (Componente)
|
|
11
|
+
* Ajuste o caminho conforme sua estrutura (ex.: "../index" ou "./index").
|
|
12
|
+
*/
|
|
13
|
+
import ModalJourneyRectification from "../../components/modal-create-activitie";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* DECORATORS
|
|
17
|
+
* Envolve o story para garantir área de visualização e evitar "modal perdido".
|
|
18
|
+
*/
|
|
19
|
+
const WithViewport: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|
20
|
+
return (
|
|
21
|
+
<View
|
|
22
|
+
style={{
|
|
23
|
+
flex: 1,
|
|
24
|
+
minHeight: 600,
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
backgroundColor: "#F3F4F6", // neutro claro p/ destacar o modal
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* META
|
|
37
|
+
*/
|
|
38
|
+
const meta: Meta<typeof ModalJourneyRectification> = {
|
|
39
|
+
title: "Componente/ModalJourneyRectification",
|
|
40
|
+
component: ModalJourneyRectification,
|
|
41
|
+
args: {
|
|
42
|
+
visible: false,
|
|
43
|
+
textTitle: "Editar atividade",
|
|
44
|
+
onClose: action("onClose"), // ação capturada no painel "Actions"
|
|
45
|
+
onPressConfirm: action("onPressConfirm"), // idem
|
|
46
|
+
},
|
|
47
|
+
argTypes: {
|
|
48
|
+
visible: {
|
|
49
|
+
control: { type: "boolean" },
|
|
50
|
+
description: "Define a visibilidade do modal.",
|
|
51
|
+
table: { category: "Controle" },
|
|
52
|
+
},
|
|
53
|
+
textTitle: {
|
|
54
|
+
control: { type: "text" },
|
|
55
|
+
description: "Título exibido no cabeçalho do modal.",
|
|
56
|
+
table: { category: "Conteúdo" },
|
|
57
|
+
},
|
|
58
|
+
onClose: {
|
|
59
|
+
description: "Callback ao cancelar/fechar o modal.",
|
|
60
|
+
table: { category: "Eventos" },
|
|
61
|
+
},
|
|
62
|
+
onPressConfirm: {
|
|
63
|
+
description: "Callback ao confirmar. Recebe { reasonValue, label, dateAndHours }.",
|
|
64
|
+
table: { category: "Eventos" },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
parameters: {
|
|
68
|
+
layout: "fullscreen",
|
|
69
|
+
docs: {
|
|
70
|
+
description: {
|
|
71
|
+
component: `
|
|
72
|
+
### ModalJourneyRectification
|
|
73
|
+
Modal para **Editar uma atividade** (motivo + data e hora) seguindo o design do sistema.
|
|
74
|
+
|
|
75
|
+
#### Uso básico
|
|
76
|
+
\`\`\`tsx
|
|
77
|
+
import ModalJourneyRectification from "caminho/do/componente";
|
|
78
|
+
|
|
79
|
+
<ModalJourneyRectification
|
|
80
|
+
visible={true}
|
|
81
|
+
textTitle="Edutar atividade"
|
|
82
|
+
onClose={() => {/* fechar */}}
|
|
83
|
+
onPressConfirm={(payload) => {
|
|
84
|
+
// payload: { reasonValue, label, dateAndHours: { date, hours } }
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
\`\`\`
|
|
88
|
+
|
|
89
|
+
- Ao confirmar, o componente dispara o \`onPressConfirm\` com os dados selecionados e **fecha** em seguida.
|
|
90
|
+
- O clique no overlay ou o botão "CANCELAR" disparam \`onClose\`.
|
|
91
|
+
`,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
decorators: [(Story) => <WithViewport>{Story()}</WithViewport>],
|
|
96
|
+
};
|
|
97
|
+
export default meta;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* STORIES
|
|
101
|
+
*/
|
|
102
|
+
type Story = StoryObj<typeof ModalJourneyRectification>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Estado padrão (fechado).
|
|
106
|
+
*/
|
|
107
|
+
export const Default: Story = {};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Modal visível para inspeção visual.
|
|
111
|
+
*/
|
|
112
|
+
export const Opened: Story = {
|
|
113
|
+
args: {
|
|
114
|
+
visible: true,
|
|
115
|
+
optionSelected: {
|
|
116
|
+
value: 22,
|
|
117
|
+
label: "Em operação - Carregamento",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
parameters: {
|
|
121
|
+
docs: {
|
|
122
|
+
description: {
|
|
123
|
+
story: "Exibe o modal aberto para validar layout, overlay e botões de ação.",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Título customizado (ex.: para variações de copy).
|
|
131
|
+
*/
|
|
132
|
+
export const WithCustomTitle: Story = {
|
|
133
|
+
args: {
|
|
134
|
+
visible: true,
|
|
135
|
+
textTitle: "Editar atividade",
|
|
136
|
+
optionSelected: {
|
|
137
|
+
value: 22,
|
|
138
|
+
label: "Em operação - Carregamento",
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
parameters: {
|
|
142
|
+
docs: {
|
|
143
|
+
description: {
|
|
144
|
+
story: "Permite validar a troca do título e o encaixe no cabeçalho do modal.",
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Playground — ajuste livre via Controls.
|
|
152
|
+
*/
|
|
153
|
+
export const Playground: Story = {
|
|
154
|
+
args: {
|
|
155
|
+
visible: false,
|
|
156
|
+
textTitle: "Editar atividade",
|
|
157
|
+
optionSelected: {
|
|
158
|
+
value: 22,
|
|
159
|
+
label: "Em operação - Carregamento",
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
parameters: {
|
|
163
|
+
docs: {
|
|
164
|
+
description: {
|
|
165
|
+
story:
|
|
166
|
+
"Use os **Controls** para alternar `visible` e personalizar `textTitle`. As ações aparecem no painel *Actions*.",
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
};
|