react-native-exp-fig 2.0.2 → 2.0.4

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 (55) hide show
  1. package/lib/commonjs/components/activities-daily/index.js +4 -4
  2. package/lib/commonjs/components/header-profile/index.js +3 -3
  3. package/lib/commonjs/components/header-profile/index.js.map +1 -1
  4. package/lib/commonjs/components/loading-details/index.js +6 -6
  5. package/lib/commonjs/components/loading-details/index.js.map +1 -1
  6. package/lib/commonjs/components/modal-activities/data-activities/index.js +47 -15
  7. package/lib/commonjs/components/modal-activities/data-activities/index.js.map +1 -1
  8. package/lib/commonjs/components/modal-activities/helpers/index.js +30 -0
  9. package/lib/commonjs/components/modal-activities/helpers/index.js.map +1 -0
  10. package/lib/commonjs/components/modal-activities/index.js +6 -6
  11. package/lib/commonjs/components/modal-activities/index.js.map +1 -1
  12. package/lib/commonjs/stories/modal-activities/modal-activities.stories.js +15 -7
  13. package/lib/commonjs/stories/modal-activities/modal-activities.stories.js.map +1 -1
  14. package/lib/commonjs/utils/get-icon-by-property/index.js +22 -12
  15. package/lib/commonjs/utils/get-icon-by-property/index.js.map +1 -1
  16. package/lib/commonjs/utils/options-activity/index.js +24 -0
  17. package/lib/commonjs/utils/options-activity/index.js.map +1 -0
  18. package/lib/module/components/activities-daily/index.js +4 -4
  19. package/lib/module/components/header-profile/index.js +3 -3
  20. package/lib/module/components/header-profile/index.js.map +1 -1
  21. package/lib/module/components/loading-details/index.js +6 -6
  22. package/lib/module/components/loading-details/index.js.map +1 -1
  23. package/lib/module/components/modal-activities/data-activities/index.js +46 -14
  24. package/lib/module/components/modal-activities/data-activities/index.js.map +1 -1
  25. package/lib/module/components/modal-activities/helpers/index.js +26 -0
  26. package/lib/module/components/modal-activities/helpers/index.js.map +1 -0
  27. package/lib/module/components/modal-activities/index.js +6 -6
  28. package/lib/module/components/modal-activities/index.js.map +1 -1
  29. package/lib/module/stories/modal-activities/modal-activities.stories.js +15 -7
  30. package/lib/module/stories/modal-activities/modal-activities.stories.js.map +1 -1
  31. package/lib/module/utils/get-icon-by-property/index.js +21 -13
  32. package/lib/module/utils/get-icon-by-property/index.js.map +1 -1
  33. package/lib/module/utils/options-activity/index.js +21 -0
  34. package/lib/module/utils/options-activity/index.js.map +1 -0
  35. package/lib/typescript/src/components/modal-activities/data-activities/index.d.ts +16 -17
  36. package/lib/typescript/src/components/modal-activities/data-activities/index.d.ts.map +1 -1
  37. package/lib/typescript/src/components/modal-activities/helpers/index.d.ts +12 -0
  38. package/lib/typescript/src/components/modal-activities/helpers/index.d.ts.map +1 -0
  39. package/lib/typescript/src/stories/modal-activities/modal-activities.stories.d.ts +3 -0
  40. package/lib/typescript/src/stories/modal-activities/modal-activities.stories.d.ts.map +1 -1
  41. package/lib/typescript/src/utils/get-icon-by-property/index.d.ts +2 -1
  42. package/lib/typescript/src/utils/get-icon-by-property/index.d.ts.map +1 -1
  43. package/lib/typescript/src/utils/options-activity/index.d.ts +18 -0
  44. package/lib/typescript/src/utils/options-activity/index.d.ts.map +1 -0
  45. package/package.json +1 -1
  46. package/src/components/activities-daily/index.tsx +116 -116
  47. package/src/components/header-profile/index.tsx +3 -3
  48. package/src/components/loading-details/index.tsx +156 -156
  49. package/src/components/modal-activities/data-activities/index.ts +107 -65
  50. package/src/components/modal-activities/helpers/index.ts +25 -0
  51. package/src/components/modal-activities/index.tsx +137 -137
  52. package/src/components/modal-activities/interface.d.ts +34 -32
  53. package/src/stories/modal-activities/modal-activities.stories.tsx +73 -64
  54. package/src/utils/get-icon-by-property/index.tsx +73 -54
  55. package/src/utils/options-activity/index.ts +13 -0
@@ -1,64 +1,73 @@
1
- import { StoryObj, Meta } from "@storybook/react";
2
- import { ModalActivities } from "../../components/modal-activities";
3
- import { IActivity } from "../../components/modal-activities/interface";
4
-
5
- const meta: Meta<typeof ModalActivities> = {
6
- title: "componente/ModalActivities",
7
- component: ModalActivities,
8
- args: {
9
- width: 120,
10
- onClose: () => {},
11
- activityType: "trabalho",
12
- isLoading: false,
13
- handleActivity: (activity: IActivity) => {
14
- return activity;
15
- },
16
- },
17
- parameters: {
18
- notes: `
19
- # MenuItem
20
-
21
- Este é um componente de MenuItem de menu.
22
- Você usa assim:
23
- \`\`\`tsx
24
- <ModalActivities
25
- {...args}
26
- activityType={activity?.tipo || "trabalho"}
27
- onClose={() => setIsVisible(false)}
28
- handleActivity={handleActivity}
29
- />
30
- \`\`\`
31
- `,
32
- },
33
- };
34
-
35
- export default meta;
36
-
37
- type Story = StoryObj<typeof meta>;
38
-
39
- export const DefaultWork: Story = {
40
- name: "modal-activities-work",
41
- args: {
42
- isLoading: false,
43
- activityType: "trabalho",
44
- onClose: () => {},
45
- handleActivity: (activity: IActivity) => () => {
46
- return activity;
47
- },
48
- },
49
- };
50
-
51
- export const DefaultRest: Story = {
52
- name: "modal-activities-rest",
53
- args: {
54
- isLoading: false,
55
- activityType: "descanso",
56
- style: {
57
- marginLeft: 0,
58
- },
59
- onClose: () => {},
60
- handleActivity: (activity: IActivity) => () => {
61
- return activity;
62
- },
63
- },
64
- };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+
5
+ import { Alert } from "react-native";
6
+ import { StoryObj, Meta } from "@storybook/react";
7
+
8
+ // components
9
+ import { ModalActivities } from "../../components/modal-activities";
10
+
11
+ //typings
12
+ import { IActivity } from "../../components/modal-activities/interface";
13
+
14
+ const handleMock = () => {
15
+ Alert.alert("Atividade selecionada");
16
+ };
17
+
18
+ const meta: Meta<typeof ModalActivities> = {
19
+ title: "componente/ModalActivities",
20
+ component: ModalActivities,
21
+ args: {
22
+ onClose: () => handleMock(),
23
+ activityType: "trabalho",
24
+ handleActivity: (activity: IActivity) => {
25
+ return activity;
26
+ },
27
+ },
28
+ parameters: {
29
+ notes: `
30
+ # MenuItem
31
+
32
+ Este é um componente de MenuItem de menu.
33
+ Você usa assim:
34
+ \`\`\`tsx
35
+ <ModalActivities
36
+ {...args}
37
+ activityType={activity?.tipo || "trabalho"}
38
+ onClose={() => setIsVisible(false)}
39
+ handleActivity={handleActivity}
40
+ />
41
+ \`\`\`
42
+ `,
43
+ },
44
+ };
45
+
46
+ export default meta;
47
+
48
+ type Story = StoryObj<typeof meta>;
49
+
50
+ export const DefaultWork: Story = {
51
+ name: "modal-activities-work",
52
+ args: {
53
+ activityType: "trabalho",
54
+ onClose: () => handleMock(),
55
+ handleActivity: (activity: IActivity) => () => {
56
+ return activity;
57
+ },
58
+ },
59
+ };
60
+
61
+ export const DefaultRest: Story = {
62
+ name: "modal-activities-rest",
63
+ args: {
64
+ activityType: "descanso",
65
+ style: {
66
+ marginLeft: 0,
67
+ },
68
+ onClose: () => handleMock(),
69
+ handleActivity: (activity: IActivity) => () => {
70
+ return activity;
71
+ },
72
+ },
73
+ };
@@ -1,54 +1,73 @@
1
- /**
2
- * IMPORTS
3
- */
4
-
5
- import React from "react";
6
- import { Icons } from "../../common/icons-svg";
7
- import { theme } from "../../styles/theme/theme";
8
-
9
- /**
10
- * Function that will map property types to corresponding icons in SVG 🛠️.
11
- * @param propertyType
12
- * @param color
13
- * @returns SVG
14
- */
15
- const getIconByProperty: React.FC<any> = (propertyType: string, color?: string) => {
16
- switch (propertyType) {
17
- case "operacao_veiculo":
18
- return <Icons color={color} icon="STEERING_WHEEL" />;
19
-
20
- case "manutencao":
21
- return <Icons color={color} icon="GEAR" />;
22
-
23
- case "aguardando_carga":
24
- return <Icons color={color} icon="TIMER" />;
25
-
26
- case "disposicao_veiculo_parado":
27
- return <Icons color={theme.colors.blue[500]} size={20} icon="TRUCK_ACTIVITY" />;
28
-
29
- case "aguardando_descarga":
30
- return <Icons color={color} icon="HOURGLASS" />;
31
-
32
- case "descanso":
33
- return <Icons color={color} icon="COFFEE" />;
34
-
35
- case "repouso_semanal":
36
- return <Icons color={color} icon="HOUSE" />;
37
-
38
- case "repouso_noturno":
39
- return <Icons color={color} icon="MOON_STARS" />;
40
-
41
- case "refeicao":
42
- return <Icons color={color} icon="CALL_BELL" />;
43
-
44
- case "ferias":
45
- return <Icons color={color} icon="ISLAND" />;
46
- default:
47
- return <Icons color={color} icon="STEERING_WHEEL" />; // Retorna uma Svg default caso o tipo de propriedade não for reconhecido.
48
- }
49
- };
50
-
51
- /**
52
- * EXPORTS
53
- */
54
- export { getIconByProperty };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+
5
+ import React from "react";
6
+ import { Icons } from "../../common/icons-svg";
7
+
8
+ export type PropertyType =
9
+ | "operacao_veiculo"
10
+ | "em_operacao"
11
+ | "manutencao"
12
+ | "tempo_disposicao"
13
+ | "aguardando_carga"
14
+ | "disposicao_veiculo_parado"
15
+ | "aguardando_descarga"
16
+ | "descanso"
17
+ | "repouso_semanal"
18
+ | "repouso_noturno"
19
+ | "refeicao"
20
+ | "ferias";
21
+
22
+ /**
23
+ * Function that will map property types to corresponding icons in SVG 🛠️.
24
+ * @param propertyType
25
+ * @param color
26
+ * @returns SVG
27
+ */
28
+ const getIconByProperty = (propertyType: PropertyType, color?: string): React.ReactNode => {
29
+ switch (propertyType) {
30
+ case "operacao_veiculo":
31
+ return <Icons color={color} icon="STEERING_WHEEL" />;
32
+
33
+ case "manutencao":
34
+ return <Icons color={color} icon="GEAR" />;
35
+
36
+ case "aguardando_carga":
37
+ return <Icons color={color} icon="TIMER" />;
38
+
39
+ case "disposicao_veiculo_parado":
40
+ return <Icons color={color} size={20} icon="TRUCK_ACTIVITY" />;
41
+
42
+ case "aguardando_descarga":
43
+ return <Icons color={color} icon="HOURGLASS" />;
44
+
45
+ case "tempo_disposicao":
46
+ return <Icons color={color} icon="TIMER" />;
47
+
48
+ case "descanso":
49
+ return <Icons color={color} icon="COFFEE" />;
50
+
51
+ case "em_operacao":
52
+ return <Icons color={color} icon="STEERING_WHEEL" />;
53
+
54
+ case "repouso_semanal":
55
+ return <Icons color={color} icon="HOUSE" />;
56
+
57
+ case "repouso_noturno":
58
+ return <Icons color={color} icon="MOON_STARS" />;
59
+
60
+ case "refeicao":
61
+ return <Icons color={color} icon="CALL_BELL" />;
62
+
63
+ case "ferias":
64
+ return <Icons color={color} icon="ISLAND" />;
65
+ default:
66
+ return <Icons color={color} icon="STEERING_WHEEL" />; // Retorna uma Svg default caso o tipo de propriedade não for reconhecido.
67
+ }
68
+ };
69
+
70
+ /**
71
+ * EXPORTS
72
+ */
73
+ export { getIconByProperty };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ const OPTIONS = [
5
+ { label: "Disp com veículo parado", value: "option1" },
6
+ { label: "Em Operação de Carregamento", value: "option2" },
7
+ { label: "Tempo à disposição", value: "option5" },
8
+ ] as const;
9
+
10
+ /**
11
+ * EXPORTS
12
+ */
13
+ export { OPTIONS };