react-native-exp-fig 0.1.26 → 0.1.28
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/activity-timeline/components/activite-row/index.js +130 -0
- package/lib/commonjs/components/activity-timeline/components/activite-row/index.js.map +1 -0
- package/lib/commonjs/components/activity-timeline/index.js +78 -0
- package/lib/commonjs/components/activity-timeline/index.js.map +1 -0
- package/lib/commonjs/components/activity-timeline/interface.js +6 -0
- package/lib/commonjs/components/activity-timeline/interface.js.map +1 -0
- package/lib/commonjs/components/activity-timeline/styles.js +84 -0
- package/lib/commonjs/components/activity-timeline/styles.js.map +1 -0
- package/lib/commonjs/components/input-text-counter/index.js +66 -0
- package/lib/commonjs/components/input-text-counter/index.js.map +1 -0
- package/lib/commonjs/components/input-text-counter/interface.d.js.map +1 -0
- package/lib/commonjs/components/input-text-counter/styles.js +42 -0
- package/lib/commonjs/components/input-text-counter/styles.js.map +1 -0
- package/lib/commonjs/components/modal-create-activitie/index.js +202 -0
- package/lib/commonjs/components/modal-create-activitie/index.js.map +1 -0
- package/lib/commonjs/components/modal-create-activitie/interface.js +2 -0
- package/lib/commonjs/components/modal-create-activitie/interface.js.map +1 -0
- package/lib/commonjs/components/modal-create-activitie/styles.js +42 -0
- package/lib/commonjs/components/modal-create-activitie/styles.js.map +1 -0
- package/lib/commonjs/components/modal-journey-rectification/index.js +202 -0
- package/lib/commonjs/components/modal-journey-rectification/index.js.map +1 -0
- package/lib/commonjs/components/modal-journey-rectification/interface.d.js +2 -0
- package/lib/commonjs/components/modal-journey-rectification/interface.d.js.map +1 -0
- package/lib/commonjs/components/modal-journey-rectification/styles.js +42 -0
- package/lib/commonjs/components/modal-journey-rectification/styles.js.map +1 -0
- package/lib/commonjs/components/{modal-activities → modals/modal-activities}/data-activities/index.js +2 -2
- package/lib/commonjs/components/modals/modal-activities/data-activities/index.js.map +1 -0
- package/lib/commonjs/components/{modal-activities → modals/modal-activities}/index.js +8 -8
- package/lib/commonjs/components/modals/modal-activities/index.js.map +1 -0
- package/lib/commonjs/components/modals/modal-activities/interface.d.js +6 -0
- package/lib/commonjs/components/modals/modal-activities/interface.d.js.map +1 -0
- package/lib/commonjs/components/modals/modal-activity-reason/index.js +161 -0
- package/lib/commonjs/components/modals/modal-activity-reason/index.js.map +1 -0
- package/lib/commonjs/components/modals/modal-activity-reason/interface.d.js +2 -0
- package/lib/commonjs/components/modals/modal-activity-reason/interface.d.js.map +1 -0
- package/lib/commonjs/components/{modal-change-activity → modals/modal-change-activity}/index.js +7 -7
- package/lib/commonjs/components/modals/modal-change-activity/index.js.map +1 -0
- package/lib/commonjs/components/selects/select-date-and-hours/index.js +95 -0
- package/lib/commonjs/components/selects/select-date-and-hours/index.js.map +1 -0
- package/lib/commonjs/components/selects/select-date-and-hours/interface.js +6 -0
- package/lib/commonjs/components/selects/select-date-and-hours/interface.js.map +1 -0
- package/lib/commonjs/components/selects/select-date-and-hours/styles.js +33 -0
- package/lib/commonjs/components/selects/select-date-and-hours/styles.js.map +1 -0
- package/lib/commonjs/components/selects/select-option/index.js +41 -39
- package/lib/commonjs/components/selects/select-option/index.js.map +1 -1
- package/lib/commonjs/components/step-indicator/index.js +7 -7
- package/lib/commonjs/components/step-indicator/index.js.map +1 -1
- package/lib/commonjs/index.js +39 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stories/activity-timeline/activity-timeline.stories.js +82 -0
- package/lib/commonjs/stories/activity-timeline/activity-timeline.stories.js.map +1 -0
- package/lib/commonjs/stories/input-text-counter/input-text-counter.stories.js +259 -0
- package/lib/commonjs/stories/input-text-counter/input-text-counter.stories.js.map +1 -0
- package/lib/commonjs/stories/modal-activities/modal-activities.stories.js +1 -1
- package/lib/commonjs/stories/modal-activities/modal-activities.stories.js.map +1 -1
- package/lib/commonjs/stories/modal-activity-reason/modal-activity-reason.stories.js +198 -0
- package/lib/commonjs/stories/modal-activity-reason/modal-activity-reason.stories.js.map +1 -0
- package/lib/commonjs/stories/modal-change-activity/modal-change-activity.stories.js +3 -3
- package/lib/commonjs/stories/modal-change-activity/modal-change-activity.stories.js.map +1 -1
- package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js +86 -0
- package/lib/commonjs/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -0
- package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js +172 -0
- package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -0
- package/lib/commonjs/stories/select-option/select-option.stories.js +3 -2
- package/lib/commonjs/stories/select-option/select-option.stories.js.map +1 -1
- package/lib/commonjs/styles/theme/theme.js +18 -2
- package/lib/commonjs/styles/theme/theme.js.map +1 -1
- package/lib/commonjs/utils/options-activity/index.js +27 -0
- package/lib/commonjs/utils/options-activity/index.js.map +1 -0
- package/lib/commonjs/utils/text-limit/index.js +37 -0
- package/lib/commonjs/utils/text-limit/index.js.map +1 -0
- package/lib/module/components/activity-timeline/components/activite-row/index.js +123 -0
- package/lib/module/components/activity-timeline/components/activite-row/index.js.map +1 -0
- package/lib/module/components/activity-timeline/index.js +70 -0
- package/lib/module/components/activity-timeline/index.js.map +1 -0
- package/lib/module/components/activity-timeline/interface.js +2 -0
- package/lib/module/components/activity-timeline/interface.js.map +1 -0
- package/lib/module/components/activity-timeline/styles.js +78 -0
- package/lib/module/components/activity-timeline/styles.js.map +1 -0
- package/lib/module/components/input-text-counter/index.js +63 -0
- package/lib/module/components/input-text-counter/index.js.map +1 -0
- package/lib/module/components/input-text-counter/interface.d.js.map +1 -0
- package/lib/module/components/input-text-counter/styles.js +37 -0
- package/lib/module/components/input-text-counter/styles.js.map +1 -0
- package/lib/module/components/modal-create-activitie/index.js +192 -0
- package/lib/module/components/modal-create-activitie/index.js.map +1 -0
- package/lib/module/components/modal-create-activitie/interface.js +2 -0
- package/lib/module/components/modal-create-activitie/interface.js.map +1 -0
- package/lib/module/components/modal-create-activitie/styles.js +37 -0
- package/lib/module/components/modal-create-activitie/styles.js.map +1 -0
- package/lib/module/components/modal-journey-rectification/index.js +192 -0
- package/lib/module/components/modal-journey-rectification/index.js.map +1 -0
- package/lib/module/components/modal-journey-rectification/interface.d.js +2 -0
- package/lib/module/components/modal-journey-rectification/interface.d.js.map +1 -0
- package/lib/module/components/modal-journey-rectification/styles.js +37 -0
- package/lib/module/components/modal-journey-rectification/styles.js.map +1 -0
- package/lib/module/components/{modal-activities → modals/modal-activities}/data-activities/index.js +2 -2
- package/lib/module/components/modals/modal-activities/data-activities/index.js.map +1 -0
- package/lib/module/components/{modal-activities → modals/modal-activities}/index.js +8 -8
- package/lib/module/components/modals/modal-activities/index.js.map +1 -0
- package/lib/module/components/modals/modal-activities/interface.d.js +2 -0
- package/lib/module/components/modals/modal-activities/interface.d.js.map +1 -0
- package/lib/module/components/modals/modal-activity-reason/index.js +151 -0
- package/lib/module/components/modals/modal-activity-reason/index.js.map +1 -0
- package/lib/module/components/modals/modal-activity-reason/interface.d.js +2 -0
- package/lib/module/components/modals/modal-activity-reason/interface.d.js.map +1 -0
- package/lib/module/components/{modal-change-activity → modals/modal-change-activity}/index.js +6 -6
- package/lib/module/components/modals/modal-change-activity/index.js.map +1 -0
- package/lib/module/components/selects/select-date-and-hours/index.js +86 -0
- package/lib/module/components/selects/select-date-and-hours/index.js.map +1 -0
- package/lib/module/components/selects/select-date-and-hours/interface.js +2 -0
- package/lib/module/components/selects/select-date-and-hours/interface.js.map +1 -0
- package/lib/module/components/selects/select-date-and-hours/styles.js +28 -0
- package/lib/module/components/selects/select-date-and-hours/styles.js.map +1 -0
- package/lib/module/components/selects/select-option/index.js +41 -42
- package/lib/module/components/selects/select-option/index.js.map +1 -1
- package/lib/module/components/step-indicator/index.js +7 -7
- package/lib/module/components/step-indicator/index.js.map +1 -1
- package/lib/module/index.js +10 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/stories/activity-timeline/activity-timeline.stories.js +75 -0
- package/lib/module/stories/activity-timeline/activity-timeline.stories.js.map +1 -0
- package/lib/module/stories/input-text-counter/input-text-counter.stories.js +253 -0
- package/lib/module/stories/input-text-counter/input-text-counter.stories.js.map +1 -0
- package/lib/module/stories/modal-activities/modal-activities.stories.js +1 -1
- package/lib/module/stories/modal-activities/modal-activities.stories.js.map +1 -1
- package/lib/module/stories/modal-activity-reason/modal-activity-reason.stories.js +193 -0
- package/lib/module/stories/modal-activity-reason/modal-activity-reason.stories.js.map +1 -0
- package/lib/module/stories/modal-change-activity/modal-change-activity.stories.js +3 -3
- package/lib/module/stories/modal-change-activity/modal-change-activity.stories.js.map +1 -1
- package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js +78 -0
- package/lib/module/stories/modal-create-activitie/modal-create-activitie.stories.js.map +1 -0
- package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js +168 -0
- package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -0
- package/lib/module/stories/select-option/select-option.stories.js +1 -1
- package/lib/module/stories/select-option/select-option.stories.js.map +1 -1
- package/lib/module/styles/theme/theme.js +18 -2
- package/lib/module/styles/theme/theme.js.map +1 -1
- package/lib/module/utils/options-activity/index.js +22 -0
- package/lib/module/utils/options-activity/index.js.map +1 -0
- package/lib/module/utils/text-limit/index.js +30 -0
- package/lib/module/utils/text-limit/index.js.map +1 -0
- package/lib/typescript/src/components/activity-timeline/components/activite-row/index.d.ts +10 -0
- package/lib/typescript/src/components/activity-timeline/index.d.ts +16 -0
- package/lib/typescript/src/components/activity-timeline/interface.d.ts +39 -0
- package/lib/typescript/src/components/activity-timeline/styles.d.ts +71 -0
- package/lib/typescript/src/components/input-text-counter/index.d.ts +33 -0
- package/lib/typescript/src/components/input-text-counter/styles.d.ts +34 -0
- package/lib/typescript/src/components/modal-create-activitie/index.d.ts +7 -0
- package/lib/typescript/src/components/modal-create-activitie/interface.d.ts +18 -0
- package/lib/typescript/src/components/modal-create-activitie/styles.d.ts +32 -0
- package/lib/typescript/src/components/modal-journey-rectification/index.d.ts +7 -0
- package/lib/typescript/src/components/modal-journey-rectification/styles.d.ts +32 -0
- package/lib/typescript/src/components/modals/modal-activity-reason/index.d.ts +7 -0
- package/lib/typescript/src/components/selects/select-date-and-hours/index.d.ts +12 -0
- package/lib/typescript/src/components/selects/select-date-and-hours/interface.d.ts +21 -0
- package/lib/typescript/src/components/selects/select-date-and-hours/styles.d.ts +24 -0
- package/lib/typescript/src/components/selects/select-option/index.d.ts +3 -6
- package/lib/typescript/src/index.d.ts +8 -3
- package/lib/typescript/src/stories/activity-timeline/activity-timeline.stories.d.ts +8 -0
- package/lib/typescript/src/stories/input-text-counter/input-text-counter.stories.d.ts +17 -0
- package/lib/typescript/src/stories/modal-activities/modal-activities.stories.d.ts +1 -1
- package/lib/typescript/src/stories/modal-activity-reason/modal-activity-reason.stories.d.ts +15 -0
- package/lib/typescript/src/stories/modal-change-activity/modal-change-activity.stories.d.ts +1 -1
- package/lib/typescript/src/stories/modal-create-activitie/modal-create-activitie.stories.d.ts +12 -0
- package/lib/typescript/src/stories/modal-journey-rectification/modal-journey-rectification.stories.d.ts +34 -0
- package/lib/typescript/src/stories/select-option/select-option.stories.d.ts +1 -1
- package/lib/typescript/src/styles/global/theme-provider.d.ts +16 -0
- package/lib/typescript/src/styles/theme/theme.d.ts +16 -0
- package/lib/typescript/src/utils/options-activity/index.d.ts +20 -0
- package/lib/typescript/src/utils/text-limit/index.d.ts +13 -0
- package/package.json +1 -1
- package/src/components/activity-timeline/components/activite-row/index.tsx +133 -0
- package/src/components/activity-timeline/index.tsx +72 -0
- package/src/components/activity-timeline/interface.ts +53 -0
- package/src/components/activity-timeline/styles.ts +69 -0
- package/src/components/input-text-counter/index.tsx +64 -0
- package/src/components/input-text-counter/interface.d.ts +41 -0
- package/src/components/input-text-counter/styles.ts +38 -0
- package/src/components/modal-create-activitie/index.tsx +211 -0
- package/src/components/modal-create-activitie/interface.ts +22 -0
- package/src/components/modal-create-activitie/styles.ts +24 -0
- package/src/components/modal-journey-rectification/index.tsx +211 -0
- package/src/components/modal-journey-rectification/interface.d.ts +22 -0
- package/src/components/modal-journey-rectification/styles.ts +24 -0
- package/src/components/{modal-activities → modals/modal-activities}/data-activities/index.ts +65 -65
- package/src/components/{modal-activities → modals/modal-activities}/index.tsx +137 -137
- package/src/components/{modal-activities → modals/modal-activities}/interface.d.ts +32 -32
- package/src/components/modals/modal-activity-reason/index.tsx +162 -0
- package/src/components/modals/modal-activity-reason/interface.d.ts +10 -0
- package/src/components/{modal-change-activity → modals/modal-change-activity}/index.tsx +6 -6
- package/src/components/selects/select-date-and-hours/index.tsx +97 -0
- package/src/components/selects/select-date-and-hours/interface.ts +31 -0
- package/src/components/selects/select-date-and-hours/styles.ts +24 -0
- package/src/components/selects/select-option/index.tsx +50 -41
- package/src/components/step-indicator/index.tsx +235 -235
- package/src/index.ts +50 -45
- package/src/stories/activity-timeline/activity-timeline.stories.tsx +90 -0
- package/src/stories/input-text-counter/input-text-counter.stories.tsx +232 -0
- package/src/stories/modal-activities/modal-activities.stories.tsx +64 -64
- package/src/stories/modal-activity-reason/modal-activity-reason.stories.tsx +192 -0
- package/src/stories/modal-change-activity/modal-change-activity.stories.tsx +49 -49
- package/src/stories/modal-create-activitie/modal-create-activitie.stories.tsx +82 -0
- package/src/stories/modal-journey-rectification/modal-journey-rectification.stories.tsx +161 -0
- package/src/stories/select-option/select-option.stories.tsx +1 -1
- package/src/styles/theme/theme.ts +17 -0
- package/src/utils/options-activity/index.ts +14 -0
- package/src/utils/text-limit/index.ts +28 -0
- package/lib/commonjs/components/modal-activities/data-activities/index.js.map +0 -1
- package/lib/commonjs/components/modal-activities/index.js.map +0 -1
- package/lib/commonjs/components/modal-activities/interface.d.js.map +0 -1
- package/lib/commonjs/components/modal-change-activity/index.js.map +0 -1
- package/lib/module/components/modal-activities/data-activities/index.js.map +0 -1
- package/lib/module/components/modal-activities/index.js.map +0 -1
- package/lib/module/components/modal-activities/interface.d.js.map +0 -1
- package/lib/module/components/modal-change-activity/index.js.map +0 -1
- /package/lib/commonjs/components/{modal-activities → input-text-counter}/interface.d.js +0 -0
- /package/lib/module/components/{modal-activities → input-text-counter}/interface.d.js +0 -0
- /package/lib/typescript/src/components/{modal-activities → modals/modal-activities}/data-activities/index.d.ts +0 -0
- /package/lib/typescript/src/components/{modal-activities → modals/modal-activities}/index.d.ts +0 -0
- /package/lib/typescript/src/components/{modal-change-activity → modals/modal-change-activity}/index.d.ts +0 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
/**
|
|
3
|
+
* IMPORTS
|
|
4
|
+
*/
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import { View, Text } from "react-native";
|
|
7
|
+
|
|
8
|
+
// components
|
|
9
|
+
import InputTextCounter from "../../components/input-text-counter";
|
|
10
|
+
/**
|
|
11
|
+
* META
|
|
12
|
+
*/
|
|
13
|
+
const meta = {
|
|
14
|
+
title: "componente/InputTextCounter",
|
|
15
|
+
component: InputTextCounter,
|
|
16
|
+
tags: ["autodocs"],
|
|
17
|
+
args: {
|
|
18
|
+
label: "Descreva o problema encontrado",
|
|
19
|
+
placeholder: "Ex: O caminhão apresentou falha no freio durante o trajeto...",
|
|
20
|
+
// props comuns de TextInput (assumindo que o componente as repasse):
|
|
21
|
+
maxLength: 150,
|
|
22
|
+
multiline: true
|
|
23
|
+
},
|
|
24
|
+
argTypes: {
|
|
25
|
+
label: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "text"
|
|
28
|
+
},
|
|
29
|
+
description: "Rótulo exibido acima do campo.",
|
|
30
|
+
table: {
|
|
31
|
+
category: "Aparência"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
placeholder: {
|
|
35
|
+
control: {
|
|
36
|
+
type: "text"
|
|
37
|
+
},
|
|
38
|
+
description: "Texto de dica quando o campo está vazio.",
|
|
39
|
+
table: {
|
|
40
|
+
category: "Aparência"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
maxLength: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "number",
|
|
46
|
+
min: 50,
|
|
47
|
+
max: 500,
|
|
48
|
+
step: 10
|
|
49
|
+
},
|
|
50
|
+
description: "Limite máximo de caracteres (ex.: 150).",
|
|
51
|
+
table: {
|
|
52
|
+
category: "Comportamento"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
multiline: {
|
|
56
|
+
control: {
|
|
57
|
+
type: "boolean"
|
|
58
|
+
},
|
|
59
|
+
description: "Habilita múltiplas linhas para textos longos.",
|
|
60
|
+
table: {
|
|
61
|
+
category: "Comportamento"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
editable: {
|
|
65
|
+
control: {
|
|
66
|
+
type: "boolean"
|
|
67
|
+
},
|
|
68
|
+
description: "Se falso, o campo fica somente leitura (desabilitado).",
|
|
69
|
+
table: {
|
|
70
|
+
category: "Comportamento"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
defaultValue: {
|
|
74
|
+
control: {
|
|
75
|
+
type: "text"
|
|
76
|
+
},
|
|
77
|
+
description: "Valor inicial não controlado (apenas na montagem).",
|
|
78
|
+
table: {
|
|
79
|
+
category: "Valor"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
value: {
|
|
83
|
+
control: {
|
|
84
|
+
type: "text"
|
|
85
|
+
},
|
|
86
|
+
description: "Valor controlado do campo. Use junto de `onChangeText` (controlado).",
|
|
87
|
+
table: {
|
|
88
|
+
category: "Valor"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
onChangeText: {
|
|
92
|
+
action: "onChangeText",
|
|
93
|
+
description: "Callback disparado a cada alteração de texto.",
|
|
94
|
+
table: {
|
|
95
|
+
category: "Eventos"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
parameters: {
|
|
100
|
+
controls: {
|
|
101
|
+
expanded: true
|
|
102
|
+
},
|
|
103
|
+
layout: "centered",
|
|
104
|
+
notes: `
|
|
105
|
+
# InputTextCounter
|
|
106
|
+
|
|
107
|
+
Campo de texto **multilinha** para descrição de manutenção com **contador de caracteres** e estilo seguindo o Figma.
|
|
108
|
+
|
|
109
|
+
## ✅ Recursos
|
|
110
|
+
- **Contador dinâmico** (ex.: \`85/150\`)
|
|
111
|
+
- **Limite configurável** via \`maxLength\` (padrão: 150)
|
|
112
|
+
- **Multilinha** para textos longos
|
|
113
|
+
- **Placeholder** claro com exemplo de preenchimento
|
|
114
|
+
|
|
115
|
+
## 🔧 Props principais
|
|
116
|
+
- \`label: string\` — título acima do campo
|
|
117
|
+
- \`placeholder: string\` — dica de preenchimento
|
|
118
|
+
- \`maxLength?: number\` — limite de caracteres (ex.: 150)
|
|
119
|
+
- \`multiline?: boolean\` — permite múltiplas linhas
|
|
120
|
+
- \`editable?: boolean\` — desabilita/ativa edição
|
|
121
|
+
- \`defaultValue?: string\` — valor inicial (não controlado)
|
|
122
|
+
- \`value?: string\`, \`onChangeText?: (t: string) => void\` — modo controlado
|
|
123
|
+
|
|
124
|
+
> Observação: se o componente estende \`TextInputProps\`, essas props já são suportadas.
|
|
125
|
+
|
|
126
|
+
## 🧩 Padrões de UX
|
|
127
|
+
- Mostre o **contador** sempre que houver \`maxLength\`.
|
|
128
|
+
- Use \`placeholder\` com **exemplo concreto** (melhora taxa de preenchimento).
|
|
129
|
+
- Em formulários longos, mantenha o campo **multilinha** com altura inicial confortável.
|
|
130
|
+
|
|
131
|
+
## 🧪 Testes (ideias)
|
|
132
|
+
- Renderiza label e placeholder corretos
|
|
133
|
+
- Respeita \`maxLength\` e exibe contador
|
|
134
|
+
- Dispara \`onChangeText\` ao digitar
|
|
135
|
+
- \`editable=false\` impede edição
|
|
136
|
+
|
|
137
|
+
## 💡 Uso básico
|
|
138
|
+
\`\`\`tsx
|
|
139
|
+
<InputTextCounter
|
|
140
|
+
label="Descreva o problema encontrado"
|
|
141
|
+
placeholder="Ex: O caminhão apresentou falha no freio durante o trajeto..."
|
|
142
|
+
maxLength={150}
|
|
143
|
+
multiline
|
|
144
|
+
/>
|
|
145
|
+
\`\`\`
|
|
146
|
+
`
|
|
147
|
+
},
|
|
148
|
+
decorators: [Story => /*#__PURE__*/React.createElement(View, {
|
|
149
|
+
style: {
|
|
150
|
+
width: 360,
|
|
151
|
+
padding: 16,
|
|
152
|
+
backgroundColor: "#F7F7F7",
|
|
153
|
+
borderRadius: 12
|
|
154
|
+
}
|
|
155
|
+
}, /*#__PURE__*/React.createElement(Story, null))]
|
|
156
|
+
};
|
|
157
|
+
export default meta;
|
|
158
|
+
/**
|
|
159
|
+
* STORIES
|
|
160
|
+
*/
|
|
161
|
+
|
|
162
|
+
// 1) Padrão
|
|
163
|
+
export const InputDefault = {
|
|
164
|
+
name: "input-descricao-default",
|
|
165
|
+
args: {
|
|
166
|
+
label: "Descrição da manutenção",
|
|
167
|
+
placeholder: "Ex: Vazamento de óleo no motor.",
|
|
168
|
+
maxLength: 150,
|
|
169
|
+
multiline: true
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// 2) Valor inicial (não controlado)
|
|
174
|
+
export const ComValorInicial = {
|
|
175
|
+
name: "com-valor-inicial",
|
|
176
|
+
args: {
|
|
177
|
+
defaultValue: "Durante o trajeto na BR-262, notei ruído metálico vindo da roda traseira direita."
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// 3) Perto do limite (simula campo quase cheio)
|
|
182
|
+
export const PertoDoLimite = {
|
|
183
|
+
name: "perto-do-limite",
|
|
184
|
+
args: {
|
|
185
|
+
maxLength: 100,
|
|
186
|
+
defaultValue: "Barulho intermitente na transmissão ao reduzir de 4ª para 3ª em descida."
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// 4) Desabilitado / Somente leitura
|
|
191
|
+
export const Desabilitado = {
|
|
192
|
+
name: "desabilitado",
|
|
193
|
+
args: {
|
|
194
|
+
editable: false,
|
|
195
|
+
placeholder: "Campo indisponível no momento"
|
|
196
|
+
},
|
|
197
|
+
parameters: {
|
|
198
|
+
docs: {
|
|
199
|
+
description: {
|
|
200
|
+
story: "Use `editable={false}` para estados de checklist revisado ou quando a OS estiver bloqueada."
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// 5) Interativo controlado (demonstração de value + onChangeText)
|
|
207
|
+
export const ControladoInterativo = {
|
|
208
|
+
name: "controlado-interativo",
|
|
209
|
+
render: args => {
|
|
210
|
+
const Wrapper = () => {
|
|
211
|
+
var _args$label, _args$maxLength;
|
|
212
|
+
const [text, setText] = useState("Inicial: ruído ao frear levemente após 20min de uso.");
|
|
213
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(InputTextCounter, _extends({}, args, {
|
|
214
|
+
label: (_args$label = args.label) !== null && _args$label !== void 0 ? _args$label : "Descrição",
|
|
215
|
+
value: text,
|
|
216
|
+
onChangeText: t => {
|
|
217
|
+
var _args$onChangeText;
|
|
218
|
+
setText(t);
|
|
219
|
+
// Storybook action:
|
|
220
|
+
// @ts-ignore - vincula ao painel de ações se existir
|
|
221
|
+
args === null || args === void 0 || (_args$onChangeText = args.onChangeText) === null || _args$onChangeText === void 0 || _args$onChangeText.call(args, t);
|
|
222
|
+
}
|
|
223
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
224
|
+
style: {
|
|
225
|
+
marginTop: 8,
|
|
226
|
+
fontSize: 12,
|
|
227
|
+
color: "#666"
|
|
228
|
+
}
|
|
229
|
+
}, text.length, "/", (_args$maxLength = args.maxLength) !== null && _args$maxLength !== void 0 ? _args$maxLength : 150, " caracteres"));
|
|
230
|
+
};
|
|
231
|
+
return /*#__PURE__*/React.createElement(Wrapper, null);
|
|
232
|
+
},
|
|
233
|
+
args: {
|
|
234
|
+
maxLength: 200,
|
|
235
|
+
multiline: true
|
|
236
|
+
},
|
|
237
|
+
parameters: {
|
|
238
|
+
docs: {
|
|
239
|
+
description: {
|
|
240
|
+
story: "Exemplo **controlado**: o estado vive no Story e é atualizado via `onChangeText`."
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// 6) Placeholder extenso (orientação contextual)
|
|
247
|
+
export const PlaceholderOrientativo = {
|
|
248
|
+
name: "placeholder-orientativo",
|
|
249
|
+
args: {
|
|
250
|
+
placeholder: "Descreva quando ocorreu, o local no veículo e se o problema é constante ou intermitente."
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
//# sourceMappingURL=input-text-counter.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","View","Text","InputTextCounter","meta","title","component","tags","args","label","placeholder","maxLength","multiline","argTypes","control","type","description","table","category","min","max","step","editable","defaultValue","value","onChangeText","action","parameters","controls","expanded","layout","notes","decorators","Story","createElement","style","width","padding","backgroundColor","borderRadius","InputDefault","name","ComValorInicial","PertoDoLimite","Desabilitado","docs","story","ControladoInterativo","render","Wrapper","_args$label","_args$maxLength","text","setText","_extends","t","_args$onChangeText","call","marginTop","fontSize","color","length","PlaceholderOrientativo"],"sources":["input-text-counter.stories.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React, { useState } from \"react\";\r\nimport { View, Text } from \"react-native\";\r\n\r\n// components\r\nimport InputTextCounter from \"../../components/input-text-counter\";\r\n\r\nimport type { Meta, StoryObj } from \"@storybook/react\";\r\n\r\n/**\r\n * META\r\n */\r\nconst meta: Meta<typeof InputTextCounter> = {\r\n title: \"componente/InputTextCounter\",\r\n component: InputTextCounter as React.FC,\r\n tags: [\"autodocs\"],\r\n args: {\r\n label: \"Descreva o problema encontrado\",\r\n placeholder: \"Ex: O caminhão apresentou falha no freio durante o trajeto...\",\r\n // props comuns de TextInput (assumindo que o componente as repasse):\r\n maxLength: 150,\r\n multiline: true,\r\n },\r\n argTypes: {\r\n label: {\r\n control: { type: \"text\" },\r\n description: \"Rótulo exibido acima do campo.\",\r\n table: { category: \"Aparência\" },\r\n },\r\n placeholder: {\r\n control: { type: \"text\" },\r\n description: \"Texto de dica quando o campo está vazio.\",\r\n table: { category: \"Aparência\" },\r\n },\r\n maxLength: {\r\n control: { type: \"number\", min: 50, max: 500, step: 10 },\r\n description: \"Limite máximo de caracteres (ex.: 150).\",\r\n table: { category: \"Comportamento\" },\r\n },\r\n multiline: {\r\n control: { type: \"boolean\" },\r\n description: \"Habilita múltiplas linhas para textos longos.\",\r\n table: { category: \"Comportamento\" },\r\n },\r\n editable: {\r\n control: { type: \"boolean\" },\r\n description: \"Se falso, o campo fica somente leitura (desabilitado).\",\r\n table: { category: \"Comportamento\" },\r\n },\r\n defaultValue: {\r\n control: { type: \"text\" },\r\n description: \"Valor inicial não controlado (apenas na montagem).\",\r\n table: { category: \"Valor\" },\r\n },\r\n value: {\r\n control: { type: \"text\" },\r\n description: \"Valor controlado do campo. Use junto de `onChangeText` (controlado).\",\r\n table: { category: \"Valor\" },\r\n },\r\n onChangeText: {\r\n action: \"onChangeText\",\r\n description: \"Callback disparado a cada alteração de texto.\",\r\n table: { category: \"Eventos\" },\r\n },\r\n },\r\n parameters: {\r\n controls: { expanded: true },\r\n layout: \"centered\",\r\n notes: `\r\n# InputTextCounter\r\n\r\nCampo de texto **multilinha** para descrição de manutenção com **contador de caracteres** e estilo seguindo o Figma.\r\n\r\n## ✅ Recursos\r\n- **Contador dinâmico** (ex.: \\`85/150\\`)\r\n- **Limite configurável** via \\`maxLength\\` (padrão: 150)\r\n- **Multilinha** para textos longos\r\n- **Placeholder** claro com exemplo de preenchimento\r\n\r\n## 🔧 Props principais\r\n- \\`label: string\\` — título acima do campo\r\n- \\`placeholder: string\\` — dica de preenchimento\r\n- \\`maxLength?: number\\` — limite de caracteres (ex.: 150)\r\n- \\`multiline?: boolean\\` — permite múltiplas linhas\r\n- \\`editable?: boolean\\` — desabilita/ativa edição\r\n- \\`defaultValue?: string\\` — valor inicial (não controlado)\r\n- \\`value?: string\\`, \\`onChangeText?: (t: string) => void\\` — modo controlado\r\n\r\n> Observação: se o componente estende \\`TextInputProps\\`, essas props já são suportadas.\r\n\r\n## 🧩 Padrões de UX\r\n- Mostre o **contador** sempre que houver \\`maxLength\\`.\r\n- Use \\`placeholder\\` com **exemplo concreto** (melhora taxa de preenchimento).\r\n- Em formulários longos, mantenha o campo **multilinha** com altura inicial confortável.\r\n\r\n## 🧪 Testes (ideias)\r\n- Renderiza label e placeholder corretos\r\n- Respeita \\`maxLength\\` e exibe contador\r\n- Dispara \\`onChangeText\\` ao digitar\r\n- \\`editable=false\\` impede edição\r\n\r\n## 💡 Uso básico\r\n\\`\\`\\`tsx\r\n<InputTextCounter\r\n label=\"Descreva o problema encontrado\"\r\n placeholder=\"Ex: O caminhão apresentou falha no freio durante o trajeto...\"\r\n maxLength={150}\r\n multiline\r\n/>\r\n\\`\\`\\`\r\n`,\r\n },\r\n decorators: [\r\n (Story) => (\r\n <View\r\n style={{\r\n width: 360,\r\n padding: 16,\r\n backgroundColor: \"#F7F7F7\",\r\n borderRadius: 12,\r\n }}\r\n >\r\n <Story />\r\n </View>\r\n ),\r\n ],\r\n};\r\n\r\nexport default meta;\r\n\r\ntype Story = StoryObj<typeof meta>;\r\n\r\n/**\r\n * STORIES\r\n */\r\n\r\n// 1) Padrão\r\nexport const InputDefault: Story = {\r\n name: \"input-descricao-default\",\r\n args: {\r\n label: \"Descrição da manutenção\",\r\n placeholder: \"Ex: Vazamento de óleo no motor.\",\r\n maxLength: 150,\r\n multiline: true,\r\n },\r\n};\r\n\r\n// 2) Valor inicial (não controlado)\r\nexport const ComValorInicial: Story = {\r\n name: \"com-valor-inicial\",\r\n args: {\r\n defaultValue:\r\n \"Durante o trajeto na BR-262, notei ruído metálico vindo da roda traseira direita.\",\r\n },\r\n};\r\n\r\n// 3) Perto do limite (simula campo quase cheio)\r\nexport const PertoDoLimite: Story = {\r\n name: \"perto-do-limite\",\r\n args: {\r\n maxLength: 100,\r\n defaultValue: \"Barulho intermitente na transmissão ao reduzir de 4ª para 3ª em descida.\",\r\n },\r\n};\r\n\r\n// 4) Desabilitado / Somente leitura\r\nexport const Desabilitado: Story = {\r\n name: \"desabilitado\",\r\n args: {\r\n editable: false,\r\n placeholder: \"Campo indisponível no momento\",\r\n },\r\n parameters: {\r\n docs: {\r\n description: {\r\n story:\r\n \"Use `editable={false}` para estados de checklist revisado ou quando a OS estiver bloqueada.\",\r\n },\r\n },\r\n },\r\n};\r\n\r\n// 5) Interativo controlado (demonstração de value + onChangeText)\r\nexport const ControladoInterativo: Story = {\r\n name: \"controlado-interativo\",\r\n render: (args) => {\r\n const Wrapper = () => {\r\n const [text, setText] = useState(\"Inicial: ruído ao frear levemente após 20min de uso.\");\r\n return (\r\n <View>\r\n <InputTextCounter\r\n {...args}\r\n label={args.label ?? \"Descrição\"}\r\n value={text}\r\n onChangeText={(t: string) => {\r\n setText(t);\r\n // Storybook action:\r\n // @ts-ignore - vincula ao painel de ações se existir\r\n args?.onChangeText?.(t);\r\n }}\r\n />\r\n <Text style={{ marginTop: 8, fontSize: 12, color: \"#666\" }}>\r\n {text.length}/{args.maxLength ?? 150} caracteres\r\n </Text>\r\n </View>\r\n );\r\n };\r\n return <Wrapper />;\r\n },\r\n args: {\r\n maxLength: 200,\r\n multiline: true,\r\n },\r\n parameters: {\r\n docs: {\r\n description: {\r\n story: \"Exemplo **controlado**: o estado vive no Story e é atualizado via `onChangeText`.\",\r\n },\r\n },\r\n },\r\n};\r\n\r\n// 6) Placeholder extenso (orientação contextual)\r\nexport const PlaceholderOrientativo: Story = {\r\n name: \"placeholder-orientativo\",\r\n args: {\r\n placeholder:\r\n \"Descreva quando ocorreu, o local no veículo e se o problema é constante ou intermitente.\",\r\n },\r\n};\r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AJA,IAAI,gBAAAgD,kBAAA,GAAJhD,IAAI,CAAEiB,YAAY,cAAA+B,kBAAA,eAAlBA,kBAAA,CAAAC,IAAA,CAAAjD,IAAI,EAAiB+C,CAAC,CAAC;QACzB;MAAE,EACH,CAAC,eACFxD,KAAA,CAAAmC,aAAA,CAAChC,IAAI;QAACiC,KAAK,EAAE;UAAEuB,SAAS,EAAE,CAAC;UAAEC,QAAQ,EAAE,EAAE;UAAEC,KAAK,EAAE;QAAO;MAAE,GACxDR,IAAI,CAACS,MAAM,EAAC,GAAC,GAAAV,eAAA,GAAC3C,IAAI,CAACG,SAAS,cAAAwC,eAAA,cAAAA,eAAA,GAAI,GAAG,EAAC,aACjC,CACF,CAAC;IAEX,CAAC;IACD,oBAAOpD,KAAA,CAAAmC,aAAA,CAACe,OAAO,MAAE,CAAC;EACpB,CAAC;EACDzC,IAAI,EAAE;IACJG,SAAS,EAAE,GAAG;IACdC,SAAS,EAAE;EACb,CAAC;EACDe,UAAU,EAAE;IACVkB,IAAI,EAAE;MACJ7B,WAAW,EAAE;QACX8B,KAAK,EAAE;MACT;IACF;EACF;AACF,CAAC;;AAED;AACA,OAAO,MAAMgB,sBAA6B,GAAG;EAC3CrB,IAAI,EAAE,yBAAyB;EAC/BjC,IAAI,EAAE;IACJE,WAAW,EACT;EACJ;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ModalActivities","meta","title","component","args","width","onClose","activityType","isLoading","handleActivity","activity","parameters","notes","DefaultWork","name","DefaultRest","style","marginLeft"],"sources":["modal-activities.stories.tsx"],"sourcesContent":["import { StoryObj, Meta } from \"@storybook/react\";\nimport { ModalActivities } from \"../../components/modal-activities\";\nimport { IActivity } from \"../../components/modal-activities/interface\";\n\nconst meta: Meta<typeof ModalActivities> = {\n title: \"componente/ModalActivities\",\n component: ModalActivities,\n args: {\n width: 120,\n onClose: () => {},\n activityType: \"trabalho\",\n isLoading: false,\n handleActivity: (activity: IActivity) => {\n return activity;\n },\n },\n parameters: {\n notes: `\n# MenuItem\n\nEste é um componente de MenuItem de menu.\nVocê usa assim:\n\\`\\`\\`tsx\n <ModalActivities\n {...args}\n activityType={activity?.tipo || \"trabalho\"}\n onClose={() => setIsVisible(false)}\n handleActivity={handleActivity}\n />\n\\`\\`\\`\n`,\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const DefaultWork: Story = {\n name: \"modal-activities-work\",\n args: {\n isLoading: false,\n activityType: \"trabalho\",\n onClose: () => {},\n handleActivity: (activity: IActivity) => () => {\n return activity;\n },\n },\n};\n\nexport const DefaultRest: Story = {\n name: \"modal-activities-rest\",\n args: {\n isLoading: false,\n activityType: \"descanso\",\n style: {\n marginLeft: 0,\n },\n onClose: () => {},\n handleActivity: (activity: IActivity) => () => {\n return activity;\n },\n },\n};\n"],"mappings":"AACA,SAASA,eAAe,QAAQ,
|
|
1
|
+
{"version":3,"names":["ModalActivities","meta","title","component","args","width","onClose","activityType","isLoading","handleActivity","activity","parameters","notes","DefaultWork","name","DefaultRest","style","marginLeft"],"sources":["modal-activities.stories.tsx"],"sourcesContent":["import { StoryObj, Meta } from \"@storybook/react\";\r\nimport { ModalActivities } from \"../../components/modals/modal-activities\";\r\nimport { IActivity } from \"../../components/modals/modal-activities/interface\";\r\n\r\nconst meta: Meta<typeof ModalActivities> = {\r\n title: \"componente/ModalActivities\",\r\n component: ModalActivities,\r\n args: {\r\n width: 120,\r\n onClose: () => {},\r\n activityType: \"trabalho\",\r\n isLoading: false,\r\n handleActivity: (activity: IActivity) => {\r\n return activity;\r\n },\r\n },\r\n parameters: {\r\n notes: `\r\n# MenuItem\r\n\r\nEste é um componente de MenuItem de menu.\r\nVocê usa assim:\r\n\\`\\`\\`tsx\r\n <ModalActivities\r\n {...args}\r\n activityType={activity?.tipo || \"trabalho\"}\r\n onClose={() => setIsVisible(false)}\r\n handleActivity={handleActivity}\r\n />\r\n\\`\\`\\`\r\n`,\r\n },\r\n};\r\n\r\nexport default meta;\r\n\r\ntype Story = StoryObj<typeof meta>;\r\n\r\nexport const DefaultWork: Story = {\r\n name: \"modal-activities-work\",\r\n args: {\r\n isLoading: false,\r\n activityType: \"trabalho\",\r\n onClose: () => {},\r\n handleActivity: (activity: IActivity) => () => {\r\n return activity;\r\n },\r\n },\r\n};\r\n\r\nexport const DefaultRest: Story = {\r\n name: \"modal-activities-rest\",\r\n args: {\r\n isLoading: false,\r\n activityType: \"descanso\",\r\n style: {\r\n marginLeft: 0,\r\n },\r\n onClose: () => {},\r\n handleActivity: (activity: IActivity) => () => {\r\n return activity;\r\n },\r\n },\r\n};\r\n"],"mappings":"AACA,SAASA,eAAe,QAAQ,0CAA0C;AAG1E,MAAMC,IAAkC,GAAG;EACzCC,KAAK,EAAE,4BAA4B;EACnCC,SAAS,EAAEH,eAAe;EAC1BI,IAAI,EAAE;IACJC,KAAK,EAAE,GAAG;IACVC,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;IACjBC,YAAY,EAAE,UAAU;IACxBC,SAAS,EAAE,KAAK;IAChBC,cAAc,EAAGC,QAAmB,IAAK;MACvC,OAAOA,QAAQ;IACjB;EACF,CAAC;EACDC,UAAU,EAAE;IACVC,KAAK,EAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE;AACF,CAAC;AAED,eAAeX,IAAI;AAInB,OAAO,MAAMY,WAAkB,GAAG;EAChCC,IAAI,EAAE,uBAAuB;EAC7BV,IAAI,EAAE;IACJI,SAAS,EAAE,KAAK;IAChBD,YAAY,EAAE,UAAU;IACxBD,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;IACjBG,cAAc,EAAGC,QAAmB,IAAK,MAAM;MAC7C,OAAOA,QAAQ;IACjB;EACF;AACF,CAAC;AAED,OAAO,MAAMK,WAAkB,GAAG;EAChCD,IAAI,EAAE,uBAAuB;EAC7BV,IAAI,EAAE;IACJI,SAAS,EAAE,KAAK;IAChBD,YAAY,EAAE,UAAU;IACxBS,KAAK,EAAE;MACLC,UAAU,EAAE;IACd,CAAC;IACDX,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;IACjBG,cAAc,EAAGC,QAAmB,IAAK,MAAM;MAC7C,OAAOA,QAAQ;IACjB;EACF;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
/**
|
|
3
|
+
* IMPORTS
|
|
4
|
+
*/
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import { View, Text, Button } from "react-native";
|
|
7
|
+
|
|
8
|
+
// components
|
|
9
|
+
import ModalActivityReason from "../../components/modals/modal-activity-reason";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* META
|
|
13
|
+
*/
|
|
14
|
+
const meta = {
|
|
15
|
+
title: "componente/ModalActivityReason",
|
|
16
|
+
component: ModalActivityReason,
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
args: {
|
|
19
|
+
visible: false,
|
|
20
|
+
textTitle: undefined
|
|
21
|
+
},
|
|
22
|
+
argTypes: {
|
|
23
|
+
visible: {
|
|
24
|
+
control: {
|
|
25
|
+
type: "boolean"
|
|
26
|
+
},
|
|
27
|
+
description: "Controla a visibilidade do modal.",
|
|
28
|
+
table: {
|
|
29
|
+
category: "Comportamento"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
textTitle: {
|
|
33
|
+
control: {
|
|
34
|
+
type: "text"
|
|
35
|
+
},
|
|
36
|
+
description: "Título exibido no cabeçalho do modal. Se não informado, usa 'Motivo da exclusão'.",
|
|
37
|
+
table: {
|
|
38
|
+
category: "Aparência"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
onClose: {
|
|
42
|
+
action: "onClose",
|
|
43
|
+
description: "Chamado ao fechar/cancelar o modal. Deve alternar `visible` para `false` no uso controlado.",
|
|
44
|
+
table: {
|
|
45
|
+
category: "Eventos"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
modalConfirm: {
|
|
49
|
+
action: "modalConfirm",
|
|
50
|
+
description: "Chamado ao confirmar a ação. Por padrão, o componente chama `modalConfirm(true)` e em seguida `onClose()`.",
|
|
51
|
+
table: {
|
|
52
|
+
category: "Eventos"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
parameters: {
|
|
57
|
+
controls: {
|
|
58
|
+
expanded: true
|
|
59
|
+
},
|
|
60
|
+
layout: "centered",
|
|
61
|
+
docs: {
|
|
62
|
+
description: {
|
|
63
|
+
component: `
|
|
64
|
+
### ModalActivityReason
|
|
65
|
+
|
|
66
|
+
Modal para solicitar **motivo/justificativa** antes de executar uma ação crítica (ex.: excluir atividade).
|
|
67
|
+
|
|
68
|
+
#### Recursos
|
|
69
|
+
- Título personalizável via \`textTitle\`
|
|
70
|
+
- Campo de texto (interno) para descrição do motivo
|
|
71
|
+
- Botões **CANCELAR** e **CONFIRMAR**
|
|
72
|
+
- Dispara \`onClose\` e \`modalConfirm\` conforme interação do usuário
|
|
73
|
+
|
|
74
|
+
#### Props
|
|
75
|
+
- \`visible: boolean\` — controla abertura/fechamento do modal
|
|
76
|
+
- \`onClose: () => void\` — chamado ao cancelar/fechar
|
|
77
|
+
- \`modalConfirm: (ok?: boolean) => void\` — chamado ao confirmar; o componente invoca \`modalConfirm(true)\` e depois \`onClose()\`
|
|
78
|
+
- \`textTitle?: string\` — título opcional do cabeçalho
|
|
79
|
+
|
|
80
|
+
> Caso \`textTitle\` não seja informado, o título padrão é **"Motivo da exclusão"**.
|
|
81
|
+
|
|
82
|
+
#### Padrão de Uso (controlado)
|
|
83
|
+
No consumo real, gerencie o estado \`visible\` fora do componente e passe callbacks:
|
|
84
|
+
\`\`\`tsx
|
|
85
|
+
const [open, setOpen] = useState(false);
|
|
86
|
+
|
|
87
|
+
<ModalActivityReason
|
|
88
|
+
visible={open}
|
|
89
|
+
onClose={() => setOpen(false)}
|
|
90
|
+
modalConfirm={() => {
|
|
91
|
+
// enviar justificativa para API (se o componente expuser)
|
|
92
|
+
setOpen(false);
|
|
93
|
+
}}
|
|
94
|
+
textTitle="Motivo da exclusão"
|
|
95
|
+
/>
|
|
96
|
+
\`\`\`
|
|
97
|
+
|
|
98
|
+
#### Testes (ideias)
|
|
99
|
+
- Renderiza com \`visible=true\`
|
|
100
|
+
- Exibe título padrão e título customizado
|
|
101
|
+
- Dispara \`onClose\` ao cancelar
|
|
102
|
+
- Dispara \`modalConfirm\` ao confirmar (e fecha em seguida)
|
|
103
|
+
`
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
decorators: [Story => /*#__PURE__*/React.createElement(View, {
|
|
108
|
+
style: {
|
|
109
|
+
width: 360,
|
|
110
|
+
padding: 16,
|
|
111
|
+
backgroundColor: "#F7F7F7",
|
|
112
|
+
borderRadius: 12
|
|
113
|
+
}
|
|
114
|
+
}, /*#__PURE__*/React.createElement(Story, null))]
|
|
115
|
+
};
|
|
116
|
+
export default meta;
|
|
117
|
+
/**
|
|
118
|
+
* STORIES
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
// 1) Aberto (básico)
|
|
122
|
+
export const AbertoBasico = {
|
|
123
|
+
name: "aberto-basico",
|
|
124
|
+
args: {
|
|
125
|
+
visible: true
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// 2) Fechado (estado inicial comum)
|
|
130
|
+
export const Fechado = {
|
|
131
|
+
name: "fechado",
|
|
132
|
+
args: {
|
|
133
|
+
visible: false
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// 3) Com título personalizado
|
|
138
|
+
export const TituloPersonalizado = {
|
|
139
|
+
name: "titulo-personalizado",
|
|
140
|
+
args: {
|
|
141
|
+
visible: true,
|
|
142
|
+
textTitle: "Justifique a alteração da atividade"
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// 4) Interativo (controlado) — demonstra fluxo completo
|
|
147
|
+
export const ControladoInterativo = {
|
|
148
|
+
name: "controlado-interativo",
|
|
149
|
+
render: args => {
|
|
150
|
+
const Wrapper = () => {
|
|
151
|
+
var _args$textTitle;
|
|
152
|
+
const [open, setOpen] = useState(false);
|
|
153
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Button, {
|
|
154
|
+
title: "Abrir modal",
|
|
155
|
+
onPress: () => setOpen(true)
|
|
156
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
157
|
+
style: {
|
|
158
|
+
marginTop: 12,
|
|
159
|
+
fontSize: 12,
|
|
160
|
+
color: "#666"
|
|
161
|
+
}
|
|
162
|
+
}, "Clique para abrir e testar CANCELAR/CONFIRMAR."), /*#__PURE__*/React.createElement(ModalActivityReason, _extends({}, args, {
|
|
163
|
+
visible: open,
|
|
164
|
+
onClose: () => {
|
|
165
|
+
var _args$onClose;
|
|
166
|
+
// aciona painel de ações do Storybook
|
|
167
|
+
// @ts-ignore
|
|
168
|
+
args === null || args === void 0 || (_args$onClose = args.onClose) === null || _args$onClose === void 0 || _args$onClose.call(args);
|
|
169
|
+
setOpen(false);
|
|
170
|
+
},
|
|
171
|
+
modalConfirm: ok => {
|
|
172
|
+
var _args$modalConfirm;
|
|
173
|
+
// @ts-ignore
|
|
174
|
+
args === null || args === void 0 || (_args$modalConfirm = args.modalConfirm) === null || _args$modalConfirm === void 0 || _args$modalConfirm.call(args, ok);
|
|
175
|
+
setOpen(false);
|
|
176
|
+
},
|
|
177
|
+
textTitle: (_args$textTitle = args.textTitle) !== null && _args$textTitle !== void 0 ? _args$textTitle : "Motivo da exclusão"
|
|
178
|
+
})));
|
|
179
|
+
};
|
|
180
|
+
return /*#__PURE__*/React.createElement(Wrapper, null);
|
|
181
|
+
},
|
|
182
|
+
args: {
|
|
183
|
+
visible: false
|
|
184
|
+
},
|
|
185
|
+
parameters: {
|
|
186
|
+
docs: {
|
|
187
|
+
description: {
|
|
188
|
+
story: "Exemplo **controlado**: o estado `visible` é gerenciado no Story para simular uso real."
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=modal-activity-reason.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","View","Text","Button","ModalActivityReason","meta","title","component","tags","args","visible","textTitle","undefined","argTypes","control","type","description","table","category","onClose","action","modalConfirm","parameters","controls","expanded","layout","docs","decorators","Story","createElement","style","width","padding","backgroundColor","borderRadius","AbertoBasico","name","Fechado","TituloPersonalizado","ControladoInterativo","render","Wrapper","_args$textTitle","open","setOpen","onPress","marginTop","fontSize","color","_extends","_args$onClose","call","ok","_args$modalConfirm","story"],"sources":["modal-activity-reason.stories.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React, { useState } from \"react\";\r\nimport type { Meta, StoryObj } from \"@storybook/react\";\r\nimport { View, Text, Button } from \"react-native\";\r\n\r\n// components\r\nimport ModalActivityReason from \"../../components/modals/modal-activity-reason\";\r\n\r\n/**\r\n * META\r\n */\r\nconst meta: Meta<typeof ModalActivityReason> = {\r\n title: \"componente/ModalActivityReason\",\r\n component: ModalActivityReason as React.FC,\r\n tags: [\"autodocs\"],\r\n args: {\r\n visible: false,\r\n textTitle: undefined,\r\n },\r\n argTypes: {\r\n visible: {\r\n control: { type: \"boolean\" },\r\n description: \"Controla a visibilidade do modal.\",\r\n table: { category: \"Comportamento\" },\r\n },\r\n textTitle: {\r\n control: { type: \"text\" },\r\n description:\r\n \"Título exibido no cabeçalho do modal. Se não informado, usa 'Motivo da exclusão'.\",\r\n table: { category: \"Aparência\" },\r\n },\r\n onClose: {\r\n action: \"onClose\",\r\n description:\r\n \"Chamado ao fechar/cancelar o modal. Deve alternar `visible` para `false` no uso controlado.\",\r\n table: { category: \"Eventos\" },\r\n },\r\n modalConfirm: {\r\n action: \"modalConfirm\",\r\n description:\r\n \"Chamado ao confirmar a ação. Por padrão, o componente chama `modalConfirm(true)` e em seguida `onClose()`.\",\r\n table: { category: \"Eventos\" },\r\n },\r\n },\r\n parameters: {\r\n controls: { expanded: true },\r\n layout: \"centered\",\r\n docs: {\r\n description: {\r\n component: `\r\n### ModalActivityReason\r\n\r\nModal para solicitar **motivo/justificativa** antes de executar uma ação crítica (ex.: excluir atividade).\r\n\r\n#### Recursos\r\n- Título personalizável via \\`textTitle\\`\r\n- Campo de texto (interno) para descrição do motivo\r\n- Botões **CANCELAR** e **CONFIRMAR**\r\n- Dispara \\`onClose\\` e \\`modalConfirm\\` conforme interação do usuário\r\n\r\n#### Props\r\n- \\`visible: boolean\\` — controla abertura/fechamento do modal\r\n- \\`onClose: () => void\\` — chamado ao cancelar/fechar\r\n- \\`modalConfirm: (ok?: boolean) => void\\` — chamado ao confirmar; o componente invoca \\`modalConfirm(true)\\` e depois \\`onClose()\\`\r\n- \\`textTitle?: string\\` — título opcional do cabeçalho\r\n\r\n> Caso \\`textTitle\\` não seja informado, o título padrão é **\"Motivo da exclusão\"**.\r\n\r\n#### Padrão de Uso (controlado)\r\nNo consumo real, gerencie o estado \\`visible\\` fora do componente e passe callbacks:\r\n\\`\\`\\`tsx\r\nconst [open, setOpen] = useState(false);\r\n\r\n<ModalActivityReason\r\n visible={open}\r\n onClose={() => setOpen(false)}\r\n modalConfirm={() => {\r\n // enviar justificativa para API (se o componente expuser)\r\n setOpen(false);\r\n }}\r\n textTitle=\"Motivo da exclusão\"\r\n/>\r\n\\`\\`\\`\r\n\r\n#### Testes (ideias)\r\n- Renderiza com \\`visible=true\\`\r\n- Exibe título padrão e título customizado\r\n- Dispara \\`onClose\\` ao cancelar\r\n- Dispara \\`modalConfirm\\` ao confirmar (e fecha em seguida)\r\n`,\r\n },\r\n },\r\n },\r\n decorators: [\r\n (Story) => (\r\n <View\r\n style={{\r\n width: 360,\r\n padding: 16,\r\n backgroundColor: \"#F7F7F7\",\r\n borderRadius: 12,\r\n }}\r\n >\r\n <Story />\r\n </View>\r\n ),\r\n ],\r\n};\r\n\r\nexport default meta;\r\n\r\ntype Story = StoryObj<typeof meta>;\r\n\r\n/**\r\n * STORIES\r\n */\r\n\r\n// 1) Aberto (básico)\r\nexport const AbertoBasico: Story = {\r\n name: \"aberto-basico\",\r\n args: {\r\n visible: true,\r\n },\r\n};\r\n\r\n// 2) Fechado (estado inicial comum)\r\nexport const Fechado: Story = {\r\n name: \"fechado\",\r\n args: {\r\n visible: false,\r\n },\r\n};\r\n\r\n// 3) Com título personalizado\r\nexport const TituloPersonalizado: Story = {\r\n name: \"titulo-personalizado\",\r\n args: {\r\n visible: true,\r\n textTitle: \"Justifique a alteração da atividade\",\r\n },\r\n};\r\n\r\n// 4) Interativo (controlado) — demonstra fluxo completo\r\nexport const ControladoInterativo: Story = {\r\n name: \"controlado-interativo\",\r\n render: (args) => {\r\n const Wrapper = () => {\r\n const [open, setOpen] = useState(false);\r\n\r\n return (\r\n <View>\r\n <Button title=\"Abrir modal\" onPress={() => setOpen(true)} />\r\n <Text style={{ marginTop: 12, fontSize: 12, color: \"#666\" }}>\r\n Clique para abrir e testar CANCELAR/CONFIRMAR.\r\n </Text>\r\n\r\n <ModalActivityReason\r\n {...args}\r\n visible={open}\r\n onClose={() => {\r\n // aciona painel de ações do Storybook\r\n // @ts-ignore\r\n args?.onClose?.();\r\n setOpen(false);\r\n }}\r\n modalConfirm={(ok?: boolean) => {\r\n // @ts-ignore\r\n args?.modalConfirm?.(ok);\r\n setOpen(false);\r\n }}\r\n textTitle={args.textTitle ?? \"Motivo da exclusão\"}\r\n />\r\n </View>\r\n );\r\n };\r\n\r\n return <Wrapper />;\r\n },\r\n args: {\r\n visible: false,\r\n },\r\n parameters: {\r\n docs: {\r\n description: {\r\n story:\r\n \"Exemplo **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TS
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// component
|
|
6
|
-
import { ModalChangeActivity } from "../../components/modal-change-activity";
|
|
6
|
+
import { ModalChangeActivity } from "../../components/modals/modal-change-activity";
|
|
7
7
|
const meta = {
|
|
8
8
|
title: "Componente/ModalChangeActivity",
|
|
9
9
|
component: ModalChangeActivity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ModalChangeActivity","meta","title","component","args","visible","descricao","onClose","modalConfirm","parameters","docs","description","Default","name"],"sources":["modal-change-activity.stories.tsx"],"sourcesContent":["/**\n * IMPORTS\n */\n\nimport type { Meta, StoryObj } from \"@storybook/react\";\n\n// component\nimport { ModalChangeActivity } from \"../../components/modal-change-activity\";\n\nconst meta: Meta<typeof ModalChangeActivity> = {\n title: \"Componente/ModalChangeActivity\",\n component: ModalChangeActivity,\n args: {\n visible: true,\n descricao: \"Repouso Noturno\",\n onClose: () => {},\n modalConfirm: () => {},\n },\n parameters: {\n docs: {\n description: {\n component: `\n# ModalChangeActivity\n\nComponente de modal para alterar a atividade do usuário.\n\n## Uso\n\\`\\`\\`tsx\n<ModalChangeActivity\n visible\n dataRegistro=\"07/03/2024\"\n descricao=\"Repouso Noturno\"\n modalConfirm={(data) => console.log(data)}\n onClose={() => console.log(\"fechar modal\")}\n/>\n\\`\\`\\`\n `,\n },\n },\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n name: \"Modal - Alterar Descanso\",\n};\n"],"mappings":"AAAA;AACA;AACA;;AAIA;AACA,SAASA,mBAAmB,QAAQ
|
|
1
|
+
{"version":3,"names":["ModalChangeActivity","meta","title","component","args","visible","descricao","onClose","modalConfirm","parameters","docs","description","Default","name"],"sources":["modal-change-activity.stories.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\n\r\nimport type { Meta, StoryObj } from \"@storybook/react\";\r\n\r\n// component\r\nimport { ModalChangeActivity } from \"../../components/modals/modal-change-activity\";\r\n\r\nconst meta: Meta<typeof ModalChangeActivity> = {\r\n title: \"Componente/ModalChangeActivity\",\r\n component: ModalChangeActivity,\r\n args: {\r\n visible: true,\r\n descricao: \"Repouso Noturno\",\r\n onClose: () => {},\r\n modalConfirm: () => {},\r\n },\r\n parameters: {\r\n docs: {\r\n description: {\r\n component: `\r\n# ModalChangeActivity\r\n\r\nComponente de modal para alterar a atividade do usuário.\r\n\r\n## Uso\r\n\\`\\`\\`tsx\r\n<ModalChangeActivity\r\n visible\r\n dataRegistro=\"07/03/2024\"\r\n descricao=\"Repouso Noturno\"\r\n modalConfirm={(data) => console.log(data)}\r\n onClose={() => console.log(\"fechar modal\")}\r\n/>\r\n\\`\\`\\`\r\n `,\r\n },\r\n },\r\n },\r\n};\r\n\r\nexport default meta;\r\n\r\ntype Story = StoryObj<typeof meta>;\r\n\r\nexport const Default: Story = {\r\n name: \"Modal - Alterar Descanso\",\r\n};\r\n"],"mappings":"AAAA;AACA;AACA;;AAIA;AACA,SAASA,mBAAmB,QAAQ,+CAA+C;AAEnF,MAAMC,IAAsC,GAAG;EAC7CC,KAAK,EAAE,gCAAgC;EACvCC,SAAS,EAAEH,mBAAmB;EAC9BI,IAAI,EAAE;IACJC,OAAO,EAAE,IAAI;IACbC,SAAS,EAAE,iBAAiB;IAC5BC,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;IACjBC,YAAY,EAAEA,CAAA,KAAM,CAAC;EACvB,CAAC;EACDC,UAAU,EAAE;IACVC,IAAI,EAAE;MACJC,WAAW,EAAE;QACXR,SAAS,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACM;IACF;EACF;AACF,CAAC;AAED,eAAeF,IAAI;AAInB,OAAO,MAAMW,OAAc,GAAG;EAC5BC,IAAI,EAAE;AACR,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
// component
|
|
6
|
+
import ModalCreteActivitie from "../../components/modal-create-activitie";
|
|
7
|
+
|
|
8
|
+
// utils / types
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: "Componente/ModalCreteActivitie",
|
|
12
|
+
component: ModalCreteActivitie,
|
|
13
|
+
args: {
|
|
14
|
+
visible: false,
|
|
15
|
+
textTitle: "Incluir atividade"
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
onClose: {
|
|
19
|
+
action: "onClose"
|
|
20
|
+
},
|
|
21
|
+
onPressConfirm: {
|
|
22
|
+
action: "onPressConfirm"
|
|
23
|
+
},
|
|
24
|
+
textTitle: {
|
|
25
|
+
control: "text",
|
|
26
|
+
description: "Título exibido no cabeçalho do modal"
|
|
27
|
+
},
|
|
28
|
+
visible: {
|
|
29
|
+
control: "boolean",
|
|
30
|
+
description: "Controla a visibilidade do modal"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
description: {
|
|
36
|
+
component: `
|
|
37
|
+
### ModalCreteActivitie
|
|
38
|
+
Modal para incluir uma atividade com motivo, data e hora.
|
|
39
|
+
|
|
40
|
+
#### Uso
|
|
41
|
+
\`\`\`tsx
|
|
42
|
+
<ModalCreteActivitie
|
|
43
|
+
visible={visible}
|
|
44
|
+
onClose={() => {}}
|
|
45
|
+
onPressConfirm={(payload) => {}}
|
|
46
|
+
textTitle="Incluir atividade"
|
|
47
|
+
/>
|
|
48
|
+
\`\`\`
|
|
49
|
+
|
|
50
|
+
- \`visible\`: abre/fecha o modal
|
|
51
|
+
- \`onClose\`: chamado ao cancelar/fechar
|
|
52
|
+
- \`onPressConfirm\`: retorna { reasonValue, label, dateAndHours }
|
|
53
|
+
- \`textTitle\`: título opcional
|
|
54
|
+
`
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
export default meta;
|
|
60
|
+
/**
|
|
61
|
+
* Apenas controla via Controls (visible true/false no painel do Storybook).
|
|
62
|
+
* Evita Template com "args: any" e mantém tipagem estrita.
|
|
63
|
+
*/
|
|
64
|
+
export const Playground = {
|
|
65
|
+
render: args => /*#__PURE__*/React.createElement(ModalCreteActivitie, args)
|
|
66
|
+
};
|
|
67
|
+
export const Fechado = {
|
|
68
|
+
args: {
|
|
69
|
+
visible: false
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export const Aberto = {
|
|
73
|
+
args: {
|
|
74
|
+
visible: true,
|
|
75
|
+
textTitle: "Incluir atividade"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=modal-create-activitie.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ModalCreteActivitie","meta","title","component","args","visible","textTitle","argTypes","onClose","action","onPressConfirm","control","description","parameters","docs","Playground","render","createElement","Fechado","Aberto"],"sources":["modal-create-activitie.stories.tsx"],"sourcesContent":["/**\n * IMPORTS\n */\nimport React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\n\n// component\nimport ModalCreteActivitie from \"../../components/modal-create-activitie\";\n\n// utils / types\ntype Props = React.ComponentProps<typeof ModalCreteActivitie>;\n\nconst meta: Meta<typeof ModalCreteActivitie> = {\n title: \"Componente/ModalCreteActivitie\",\n component: ModalCreteActivitie,\n args: {\n visible: false,\n textTitle: \"Incluir atividade\",\n },\n argTypes: {\n onClose: { action: \"onClose\" },\n onPressConfirm: { action: \"onPressConfirm\" },\n textTitle: {\n control: \"text\",\n description: \"Título exibido no cabeçalho do modal\",\n },\n visible: {\n control: \"boolean\",\n description: \"Controla a visibilidade do modal\",\n },\n },\n parameters: {\n docs: {\n description: {\n component: `\n### ModalCreteActivitie\nModal para incluir uma atividade com motivo, data e hora.\n\n#### Uso\n\\`\\`\\`tsx\n<ModalCreteActivitie\n visible={visible}\n onClose={() => {}}\n onPressConfirm={(payload) => {}}\n textTitle=\"Incluir atividade\"\n/>\n\\`\\`\\`\n\n- \\`visible\\`: abre/fecha o modal\n- \\`onClose\\`: chamado ao cancelar/fechar\n- \\`onPressConfirm\\`: retorna { reasonValue, label, dateAndHours }\n- \\`textTitle\\`: título opcional\n `,\n },\n },\n },\n} as Meta<typeof ModalCreteActivitie>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof ModalCreteActivitie>;\n\n/**\n * Apenas controla via Controls (visible true/false no painel do Storybook).\n * Evita Template com \"args: any\" e mantém tipagem estrita.\n */\nexport const Playground: Story = {\n render: (args: Props) => <ModalCreteActivitie {...args} />,\n};\n\nexport const Fechado: Story = {\n args: {\n visible: false,\n },\n};\n\nexport const Aberto: Story = {\n args: {\n visible: true,\n textTitle: \"Incluir atividade\",\n },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAGzB;AACA,OAAOC,mBAAmB,MAAM,yCAAyC;;AAEzE;;AAGA,MAAMC,IAAsC,GAAG;EAC7CC,KAAK,EAAE,gCAAgC;EACvCC,SAAS,EAAEH,mBAAmB;EAC9BI,IAAI,EAAE;IACJC,OAAO,EAAE,KAAK;IACdC,SAAS,EAAE;EACb,CAAC;EACDC,QAAQ,EAAE;IACRC,OAAO,EAAE;MAAEC,MAAM,EAAE;IAAU,CAAC;IAC9BC,cAAc,EAAE;MAAED,MAAM,EAAE;IAAiB,CAAC;IAC5CH,SAAS,EAAE;MACTK,OAAO,EAAE,MAAM;MACfC,WAAW,EAAE;IACf,CAAC;IACDP,OAAO,EAAE;MACPM,OAAO,EAAE,SAAS;MAClBC,WAAW,EAAE;IACf;EACF,CAAC;EACDC,UAAU,EAAE;IACVC,IAAI,EAAE;MACJF,WAAW,EAAE;QACXT,SAAS,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACM;IACF;EACF;AACF,CAAqC;AAErC,eAAeF,IAAI;AAInB;AACA;AACA;AACA;AACA,OAAO,MAAMc,UAAiB,GAAG;EAC/BC,MAAM,EAAGZ,IAAW,iBAAKL,KAAA,CAAAkB,aAAA,CAACjB,mBAAmB,EAAKI,IAAO;AAC3D,CAAC;AAED,OAAO,MAAMc,OAAc,GAAG;EAC5Bd,IAAI,EAAE;IACJC,OAAO,EAAE;EACX;AACF,CAAC;AAED,OAAO,MAAMc,MAAa,GAAG;EAC3Bf,IAAI,EAAE;IACJC,OAAO,EAAE,IAAI;IACbC,SAAS,EAAE;EACb;AACF,CAAC","ignoreList":[]}
|