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.
Files changed (36) hide show
  1. package/lib/commonjs/components/modal-create-activitie/index.js +8 -6
  2. package/lib/commonjs/components/modal-create-activitie/index.js.map +1 -1
  3. package/lib/commonjs/components/modal-create-activitie/interface.js.map +1 -1
  4. package/lib/commonjs/components/selects/select-option/index.js +8 -6
  5. package/lib/commonjs/components/selects/select-option/index.js.map +1 -1
  6. package/lib/commonjs/components/selects/select-option/interface.d.js.map +1 -1
  7. package/lib/commonjs/components/user-profile/index.js +2 -1
  8. package/lib/commonjs/components/user-profile/index.js.map +1 -1
  9. package/lib/commonjs/components/user-profile/interface.d.js.map +1 -1
  10. package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js +4 -0
  11. package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -1
  12. package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js +35 -23
  13. package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -1
  14. package/lib/module/components/modal-create-activitie/index.js +8 -6
  15. package/lib/module/components/modal-create-activitie/index.js.map +1 -1
  16. package/lib/module/components/modal-create-activitie/interface.js.map +1 -1
  17. package/lib/module/components/selects/select-option/index.js +8 -6
  18. package/lib/module/components/selects/select-option/index.js.map +1 -1
  19. package/lib/module/components/selects/select-option/interface.d.js.map +1 -1
  20. package/lib/module/components/user-profile/index.js +2 -1
  21. package/lib/module/components/user-profile/index.js.map +1 -1
  22. package/lib/module/components/user-profile/interface.d.js.map +1 -1
  23. package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js +4 -0
  24. package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -1
  25. package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js +35 -23
  26. package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -1
  27. package/lib/typescript/src/components/modal-create-activitie/interface.d.ts +1 -0
  28. package/package.json +1 -1
  29. package/src/components/modal-create-activitie/index.tsx +5 -4
  30. package/src/components/modal-create-activitie/interface.ts +1 -0
  31. package/src/components/selects/select-option/index.tsx +14 -5
  32. package/src/components/selects/select-option/interface.d.ts +1 -0
  33. package/src/components/user-profile/index.tsx +32 -29
  34. package/src/components/user-profile/interface.d.ts +1 -0
  35. package/src/stories/modal-create-activitie/modal-create-activitie.stories.tsx +4 -0
  36. 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
- <Box
137
- width={"100%"}
138
- flexStyle={{
139
- flexDirection: "row",
140
- alignItems: "center",
141
- justifyContent: "flex-start",
142
- textAlign: "center",
143
- }}
144
- paddingStyle={{ paddingTop: 5 }}
145
- >
146
- <Typography
147
- text={"CONECTADO: "}
148
- color={color?.colorText ?? theme.colors.neutral[25]}
149
- size={theme.fontSizes.sm}
150
- fontFamily={theme.fonts.inter_medium_500}
151
- fontWeight="500"
152
- lineHeight={theme.fontSizes.lg ?? 18}
153
- letterSpacing={"regular"}
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
- <Typography
157
- text={bluetoothIsConnected ? placa_cavalo : ""}
158
- color={theme.colors.green[400]}
159
- size={theme.fontSizes.sm}
160
- fontFamily={theme.fonts.inter_bold_700}
161
- fontWeight="700"
162
- lineHeight={theme.fontSizes.lg ?? 18}
163
- letterSpacing={"regular"}
164
- />
165
- </Box>
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
@@ -12,6 +12,7 @@ interface IUserProfile extends ViewProps, IGlobalCss {
12
12
  cpf: string;
13
13
  placa_cavalo: string;
14
14
  bluetoothIsConnected: boolean;
15
+ situacao?: string;
15
16
  app_version: string;
16
17
  handleProfileView: () => void;
17
18
  }
@@ -79,6 +79,10 @@ export const Aberto: Story = {
79
79
  args: {
80
80
  visible: true,
81
81
  textTitle: "Incluir atividade",
82
+ optionSelected: {
83
+ value: 22,
84
+ label: "Em operação - Carregamento",
85
+ },
82
86
  onPressConfirm: (payload) => {
83
87
  console.log("payload", payload);
84
88
  },
@@ -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"),// 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:
64
- "Callback ao confirmar. Recebe { reasonValue, label, dateAndHours }.",
65
- table: { category: "Eventos" },
66
- },
67
- },
68
- parameters: {
69
- layout: "fullscreen",
70
- docs: {
71
- description: {
72
- component: `
73
- ### ModalJourneyRectification
74
- Modal para **Editar uma atividade** (motivo + data e hora) seguindo o design do sistema.
75
-
76
- #### Uso básico
77
- \`\`\`tsx
78
- import ModalJourneyRectification from "caminho/do/componente";
79
-
80
- <ModalJourneyRectification
81
- visible={true}
82
- textTitle="Edutar atividade"
83
- onClose={() => {/* fechar */}}
84
- onPressConfirm={(payload) => {
85
- // payload: { reasonValue, label, dateAndHours: { date, hours } }
86
- }}
87
- />
88
- \`\`\`
89
-
90
- - Ao confirmar, o componente dispara o \`onPressConfirm\` com os dados selecionados e **fecha** em seguida.
91
- - O clique no overlay ou o botão "CANCELAR" disparam \`onClose\`.
92
- `,
93
- },
94
- },
95
- },
96
- decorators: [(Story) => <WithViewport>{Story()}</WithViewport>],
97
- };
98
- export default meta;
99
-
100
- /**
101
- * STORIES
102
- */
103
- type Story = StoryObj<typeof ModalJourneyRectification>;
104
-
105
- /**
106
- * Estado padrão (fechado).
107
- */
108
- export const Default: Story = {};
109
-
110
- /**
111
- * Modal visível para inspeção visual.
112
- */
113
- export const Opened: Story = {
114
- args: {
115
- visible: true,
116
- },
117
- parameters: {
118
- docs: {
119
- description: {
120
- story:
121
- "Exibe o modal aberto para validar layout, overlay e botões de ação.",
122
- },
123
- },
124
- },
125
- };
126
-
127
- /**
128
- * Título customizado (ex.: para variações de copy).
129
- */
130
- export const WithCustomTitle: Story = {
131
- args: {
132
- visible: true,
133
- textTitle: "Registrar atividade manualmente",
134
- },
135
- parameters: {
136
- docs: {
137
- description: {
138
- story:
139
- "Permite validar a troca do título e o encaixe no cabeçalho do modal.",
140
- },
141
- },
142
- },
143
- };
144
-
145
- /**
146
- * Playground — ajuste livre via Controls.
147
- */
148
- export const Playground: Story = {
149
- args: {
150
- visible: false,
151
- textTitle: "Editar atividade",
152
- },
153
- parameters: {
154
- docs: {
155
- description: {
156
- story:
157
- "Use os **Controls** para alternar `visible` e personalizar `textTitle`. As ações aparecem no painel *Actions*.",
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
+ };