jornada-ui 0.4.9 → 0.4.11
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/capture-photo/index.js +49 -49
- package/lib/commonjs/components/capture-photo/index.js.map +1 -1
- package/lib/commonjs/components/supply-error-card/index.js +13 -12
- package/lib/commonjs/components/supply-error-card/index.js.map +1 -1
- package/lib/commonjs/stories/supply-error-card/supply-error-card.stories.js +14 -14
- package/lib/commonjs/stories/supply-error-card/supply-error-card.stories.js.map +1 -1
- package/lib/module/components/capture-photo/index.js +49 -49
- package/lib/module/components/capture-photo/index.js.map +1 -1
- package/lib/module/components/supply-error-card/index.js +13 -12
- package/lib/module/components/supply-error-card/index.js.map +1 -1
- package/lib/module/stories/supply-error-card/supply-error-card.stories.js +14 -14
- package/lib/module/stories/supply-error-card/supply-error-card.stories.js.map +1 -1
- package/lib/typescript/commonjs/src/components/capture-photo/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/capture-photo/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/supply-error-card/index.d.ts +3 -8
- package/lib/typescript/commonjs/src/components/supply-error-card/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/capture-photo/index.d.ts +1 -1
- package/lib/typescript/module/src/components/capture-photo/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/supply-error-card/index.d.ts +3 -8
- package/lib/typescript/module/src/components/supply-error-card/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/capture-photo/index.tsx +43 -55
- package/src/components/supply-error-card/index.tsx +109 -105
- package/src/components/supply-error-card/interface.d.ts +133 -139
- package/src/stories/supply-error-card/supply-error-card.stories.tsx +72 -72
|
@@ -7,11 +7,11 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _index = _interopRequireDefault(require("../typography/index.js"));
|
|
10
|
-
var _index2 = require("
|
|
10
|
+
var _index2 = _interopRequireDefault(require("../box/index.js"));
|
|
11
|
+
var _index3 = require("../../common/icons-svg/index.js");
|
|
11
12
|
var _asBaseComponent = require("../../@types/as-base-component.js");
|
|
12
13
|
var _theme = require("../../styles/theme/theme.js");
|
|
13
14
|
var _styles = require("./styles.js");
|
|
14
|
-
var _jornadaUi = require("jornada-ui");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
@@ -40,61 +40,59 @@ const CapturePhoto = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
40
40
|
borderStyled,
|
|
41
41
|
color,
|
|
42
42
|
fontStyle,
|
|
43
|
-
opacity,
|
|
43
|
+
opacity = 1,
|
|
44
44
|
style,
|
|
45
45
|
smallText,
|
|
46
46
|
paddingStyle,
|
|
47
47
|
backgroundColor
|
|
48
48
|
} = props;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
height,
|
|
55
|
-
marginStyle,
|
|
56
|
-
flexStyle,
|
|
57
|
-
title,
|
|
58
|
-
borderStyled,
|
|
59
|
-
color,
|
|
60
|
-
fontStyle,
|
|
49
|
+
|
|
50
|
+
// estilos do container SEMPRE aplicados no Touchable
|
|
51
|
+
const containerStyle = {
|
|
52
|
+
width: width,
|
|
53
|
+
// aceita number | string ('48%')
|
|
54
|
+
height: height,
|
|
61
55
|
opacity,
|
|
62
|
-
smallText,
|
|
63
|
-
paddingStyle,
|
|
64
56
|
backgroundColor,
|
|
65
|
-
|
|
57
|
+
borderWidth: Number(borderStyled?.borderWidth) || 0,
|
|
58
|
+
borderColor: borderStyled?.borderColor,
|
|
59
|
+
borderRadius: Number(borderStyled?.borderRadius) || 0,
|
|
60
|
+
alignItems: flexStyle?.alignItems ?? "center",
|
|
61
|
+
justifyContent: flexStyle?.justifyContent ?? "center",
|
|
62
|
+
flexDirection: flexStyle?.flexDirection ?? "column",
|
|
63
|
+
paddingTop: paddingStyle?.paddingTop,
|
|
64
|
+
paddingBottom: paddingStyle?.paddingBottom,
|
|
65
|
+
overflow: "hidden",
|
|
66
|
+
// garante o recorte da imagem no borderRadius
|
|
67
|
+
...(marginStyle ?? {})
|
|
66
68
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, style],
|
|
91
|
-
onPress: takePhotoWithImagePicker,
|
|
92
|
-
testID: testID,
|
|
93
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.Icons, {
|
|
69
|
+
|
|
70
|
+
// seus styles existentes (caso tenha regras adicionais)
|
|
71
|
+
const styles = (0, _styles.styles)(props);
|
|
72
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
73
|
+
ref: ref,
|
|
74
|
+
activeOpacity: 0.7,
|
|
75
|
+
onPress: takePhotoWithImagePicker,
|
|
76
|
+
testID: testID,
|
|
77
|
+
style: [styles.capturePhoto, containerStyle, style] // <- container SEMPRE aqui
|
|
78
|
+
,
|
|
79
|
+
children: imageComprovante ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
80
|
+
source: {
|
|
81
|
+
uri: imageComprovante
|
|
82
|
+
},
|
|
83
|
+
resizeMode: "cover"
|
|
84
|
+
// a imagem agora só preenche o container
|
|
85
|
+
,
|
|
86
|
+
style: _reactNative.StyleSheet.flatten([{
|
|
87
|
+
width: "100%",
|
|
88
|
+
height: "100%"
|
|
89
|
+
}])
|
|
90
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
91
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Icons, {
|
|
94
92
|
icon: "CAMERA_PLUS",
|
|
95
93
|
size: _theme.theme.fontSizes["2xl"] || 24,
|
|
96
94
|
color: color?.colorSvg
|
|
97
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
|
|
98
96
|
width: 140,
|
|
99
97
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
|
|
100
98
|
text: title.text || "Sem foto capturada.",
|
|
@@ -103,7 +101,9 @@ const CapturePhoto = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
103
101
|
size: fontStyle?.fontSize ? fontStyle?.fontSize : _theme.theme.fontSizes.md,
|
|
104
102
|
fontFamily: fontStyle?.fontFamily ? fontStyle?.fontFamily : _theme.theme.fonts.inter_regular_400,
|
|
105
103
|
lineHeight: fontStyle?.lineHeight ? fontStyle?.lineHeight : _theme.theme.fontSizes["2xl"],
|
|
106
|
-
letterSpacing:
|
|
104
|
+
letterSpacing:
|
|
105
|
+
// RN espera número; se "regular" for seu token, mapeie pra número no Typography
|
|
106
|
+
fontStyle?.letterSpacing ?? "regular",
|
|
107
107
|
marginTop: 8
|
|
108
108
|
})
|
|
109
109
|
}), smallText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
|
|
@@ -113,14 +113,14 @@ const CapturePhoto = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
113
113
|
size: fontStyle?.fontSize ? fontStyle?.fontSize : _theme.theme.fontSizes.sm,
|
|
114
114
|
fontFamily: fontStyle?.fontFamily ? fontStyle?.fontFamily : _theme.theme.fonts.inter_regular_400,
|
|
115
115
|
lineHeight: fontStyle?.lineHeight ? fontStyle?.lineHeight : _theme.theme.fontSizes.md,
|
|
116
|
-
letterSpacing: fontStyle?.letterSpacing
|
|
116
|
+
letterSpacing: fontStyle?.letterSpacing ?? "regular"
|
|
117
117
|
})]
|
|
118
118
|
})
|
|
119
119
|
});
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* EXPORTS
|
|
124
124
|
*/
|
|
125
125
|
var _default = exports.default = (0, _asBaseComponent.asBaseComponent)(CapturePhoto);
|
|
126
126
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_index","_interopRequireDefault","_index2","_asBaseComponent","_theme","_styles","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_index","_interopRequireDefault","_index2","_index3","_asBaseComponent","_theme","_styles","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CapturePhoto","forwardRef","props","ref","imageComprovante","takePhotoWithImagePicker","testID","width","height","marginStyle","flexStyle","title","borderStyled","color","fontStyle","opacity","style","smallText","paddingStyle","backgroundColor","containerStyle","borderWidth","Number","borderColor","borderRadius","alignItems","justifyContent","flexDirection","paddingTop","paddingBottom","overflow","styles","makeStyles","jsx","TouchableOpacity","activeOpacity","onPress","capturePhoto","children","Image","source","uri","resizeMode","StyleSheet","flatten","jsxs","Fragment","Icons","icon","size","theme","fontSizes","colorSvg","text","align","textAlign","colorText","colors","gray","fontSize","md","fontFamily","fonts","inter_regular_400","lineHeight","letterSpacing","marginTop","textSmallPhoto","sm","_default","exports","asBaseComponent"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/capture-photo/index.tsx"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AAGA,IAAAK,OAAA,GAAAL,OAAA;AAGA,IAAAM,gBAAA,GAAAN,OAAA;AAIA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAgD,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAG,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,CAAAW,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAAAN,CAAA,IAAAH,CAAA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K,CAACC,SAAS,CAACiB,EAAG;QACrEP,UAAU,EACR/C,SAAS,EAAE+C,UAAU,GAAG/C,SAAS,EAAE+C,UAAU,GAAGX,YAAK,CAACY,KAAK,CAACC,iBAC7D;QACDC,UAAU,EAAElD,SAAS,EAAEkD,UAAU,GAAGlD,SAAS,EAAEkD,UAAU,GAAGd,YAAK,CAACC,SAAS,CAACS,EAAG;QAC/EK,aAAa,EAAGnD,SAAS,EAAEmD,aAAa,IAAa;MAAkB,CACxE,CACF;IAAA,CACD;EACH,CACe,CAAC;AAEvB,CAAC,CAAC;;AAEF;AACA;AACA;AAFA,IAAAI,QAAA,GAAAC,OAAA,CAAAvF,OAAA,GAGe,IAAAwF,gCAAe,EAACvE,YAAY,CAAC","ignoreList":[]}
|
|
@@ -14,8 +14,8 @@ var _theme = require("../../styles/theme/theme.js");
|
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
|
-
/**
|
|
18
|
-
* IMPORTS
|
|
17
|
+
/**
|
|
18
|
+
* IMPORTS
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
// componentes
|
|
@@ -26,19 +26,19 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
26
26
|
|
|
27
27
|
// styles / theme
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
* Componente SupplyErrorCard para a interação da ui.
|
|
29
|
+
/**
|
|
30
|
+
* Componente SupplyErrorCard para a interação da ui.
|
|
31
31
|
*/const SupplyErrorCard = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
32
32
|
const {
|
|
33
33
|
backgroundColor,
|
|
34
|
-
|
|
34
|
+
errors,
|
|
35
35
|
handleOnPress
|
|
36
36
|
} = props;
|
|
37
37
|
const [isExpanded, setIsExpanded] = (0, _react.useState)(false);
|
|
38
38
|
|
|
39
39
|
/**Função para alternar a expansão do card */
|
|
40
40
|
const handleToggleExpand = () => setIsExpanded(prev => !prev);
|
|
41
|
-
const firstMessage =
|
|
41
|
+
const firstMessage = errors?.[0];
|
|
42
42
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
43
43
|
onPress: handleToggleExpand,
|
|
44
44
|
activeOpacity: 0.9,
|
|
@@ -74,11 +74,11 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
74
74
|
flexStyle: {
|
|
75
75
|
justifyContent: "center"
|
|
76
76
|
},
|
|
77
|
-
children: isExpanded ?
|
|
77
|
+
children: isExpanded ? errors?.map((error, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
78
78
|
activeOpacity: 0.7,
|
|
79
79
|
onPress: () => handleOnPress(error),
|
|
80
80
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
|
|
81
|
-
text: `${index + 1}. ${error.
|
|
81
|
+
text: `${index + 1}. ${error.descricao ?? "Sem mensagens de erro"}`,
|
|
82
82
|
color: _theme.theme.colors.red[900],
|
|
83
83
|
size: _theme.theme.fontSizes.sm,
|
|
84
84
|
fontFamily: _theme.theme.fonts.inter_medium_500,
|
|
@@ -86,7 +86,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
86
86
|
marginBottom: _theme.theme.margins.xs
|
|
87
87
|
})
|
|
88
88
|
}, error?.id)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.default, {
|
|
89
|
-
text: firstMessage ? `1. ${firstMessage.
|
|
89
|
+
text: firstMessage ? `1. ${firstMessage.descricao}` : "Nenhum erro disponível",
|
|
90
90
|
color: _theme.theme.colors.red[900],
|
|
91
91
|
size: _theme.theme.fontSizes.sm,
|
|
92
92
|
fontFamily: _theme.theme.fonts.inter_medium_500,
|
|
@@ -101,7 +101,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
101
101
|
},
|
|
102
102
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.Icons, {
|
|
103
103
|
icon: isExpanded ? "ARROW_CHEVRON_UP" : "ARROW_CHEVRON_DOWN",
|
|
104
|
-
size: 32
|
|
104
|
+
size: 32,
|
|
105
|
+
color: _theme.theme.colors.gray[800]
|
|
105
106
|
})
|
|
106
107
|
})]
|
|
107
108
|
})
|
|
@@ -110,8 +111,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
110
111
|
});
|
|
111
112
|
SupplyErrorCard.displayName = "SupplyErrorCard";
|
|
112
113
|
|
|
113
|
-
/**
|
|
114
|
-
* EXPORTS
|
|
114
|
+
/**
|
|
115
|
+
* EXPORTS
|
|
115
116
|
*/
|
|
116
117
|
var _default = exports.default = (0, _asBaseComponent.asBaseComponent)(SupplyErrorCard);
|
|
117
118
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_index","_interopRequireDefault","_index2","_index3","_asBaseComponent","_theme","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SupplyErrorCard","forwardRef","props","ref","backgroundColor","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_index","_interopRequireDefault","_index2","_index3","_asBaseComponent","_theme","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SupplyErrorCard","forwardRef","props","ref","backgroundColor","errors","handleOnPress","isExpanded","setIsExpanded","useState","handleToggleExpand","prev","firstMessage","jsx","TouchableOpacity","onPress","activeOpacity","children","width","borderStyled","borderRadius","theme","borderWidths","thick_medium","borderWidth","thin_medium","borderColor","colors","orange","jsxs","yellow","thin_bold","flexStyle","flexDirection","justifyContent","paddingStyle","padding","paddings","xs","Icons","icon","size","map","error","index","text","descricao","color","red","fontSizes","sm","fontFamily","fonts","inter_medium_500","lineHeight","lg","marginBottom","margins","id","alignItems","textAlign","gray","displayName","_default","exports","asBaseComponent"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/supply-error-card/index.tsx"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AAGA,IAAAK,OAAA,GAAAL,OAAA;AAIA,IAAAM,gBAAA,GAAAN,OAAA;AAGA,IAAAO,MAAA,GAAAP,OAAA;AAAiD,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAG,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAU,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAA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EAAE;UACb,CAAE;UAAA3C,QAAA,eAEF,IAAArC,WAAA,CAAAiC,GAAA,EAACpC,OAAA,CAAA8D,KAAK;YACJC,IAAI,EAAEjC,UAAU,GAAG,kBAAkB,GAAG,oBAAqB;YAC7DkC,IAAI,EAAE,EAAG;YACTM,KAAK,EAAE1B,YAAK,CAACM,MAAM,CAACkC,IAAI,CAAC,GAAG;UAAE,CAC/B;QAAC,CACC,CAAC;MAAA,CACH;IAAC,CACH;EAAC,CACU,CAAC;AAEvB,CAAC,CAAC;AAEF7D,eAAe,CAAC8D,WAAW,GAAG,iBAAiB;;AAE/C;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAjF,OAAA,GAGe,IAAAkF,gCAAe,EAACjE,eAAe,CAAC","ignoreList":[]}
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.SupplyErrorCardNotMessage = exports.Default = void 0;
|
|
7
7
|
var _index = _interopRequireDefault(require("../../components/supply-error-card/index.js"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
/**
|
|
10
|
-
* IMPORTS
|
|
9
|
+
/**
|
|
10
|
+
* IMPORTS
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
// component
|
|
@@ -16,19 +16,19 @@ const meta = {
|
|
|
16
16
|
title: "componente/SupplyErrorCard",
|
|
17
17
|
component: _index.default,
|
|
18
18
|
args: {
|
|
19
|
-
|
|
19
|
+
errors: [{
|
|
20
20
|
id: 101,
|
|
21
|
-
|
|
21
|
+
descricacao: "Erro ao sincronizar abastecimento #101. Clique para corrigir."
|
|
22
22
|
}, {
|
|
23
23
|
id: 203,
|
|
24
|
-
|
|
24
|
+
descricacao: "Valor inválido no abastecimento #203."
|
|
25
25
|
}, {
|
|
26
26
|
id: 310,
|
|
27
|
-
|
|
27
|
+
descricacao: "Imagem do comprovante ausente no abastecimento #310."
|
|
28
28
|
}]
|
|
29
29
|
},
|
|
30
30
|
argTypes: {
|
|
31
|
-
|
|
31
|
+
errors: {
|
|
32
32
|
description: "Lista de mensagens de erro/exceção relacionadas a abastecimentos.",
|
|
33
33
|
control: "object",
|
|
34
34
|
table: {
|
|
@@ -47,13 +47,13 @@ Ao **clicar**, expande e mostra a lista completa. O ícone alterna entre *chevro
|
|
|
47
47
|
|
|
48
48
|
## Uso básico
|
|
49
49
|
\`\`\`tsx
|
|
50
|
-
const
|
|
51
|
-
{ id: 101,
|
|
52
|
-
{ id: 203,
|
|
53
|
-
{ id: 310,
|
|
50
|
+
const errors = [
|
|
51
|
+
{ id: 101, descricao: "Erro ao sincronizar abastecimento #101. Clique para corrigir." },
|
|
52
|
+
{ id: 203, descricao: "Valor inválido no abastecimento #203." },
|
|
53
|
+
{ id: 310, descricao: "Imagem do comprovante ausente no abastecimento #310." },
|
|
54
54
|
];
|
|
55
55
|
|
|
56
|
-
<SupplyErrorCard
|
|
56
|
+
<SupplyErrorCard errors={mensagens} />
|
|
57
57
|
\`\`\`
|
|
58
58
|
|
|
59
59
|
## Dicas
|
|
@@ -66,7 +66,7 @@ var _default = exports.default = meta;
|
|
|
66
66
|
const Default = exports.Default = {
|
|
67
67
|
name: "supply-error-card-default",
|
|
68
68
|
args: {
|
|
69
|
-
|
|
69
|
+
errors: [{
|
|
70
70
|
id: 101,
|
|
71
71
|
mensagem: "Erro ao sincronizar abastecimento #101. Clique para corrigir."
|
|
72
72
|
}, {
|
|
@@ -81,7 +81,7 @@ const Default = exports.Default = {
|
|
|
81
81
|
const SupplyErrorCardNotMessage = exports.SupplyErrorCardNotMessage = {
|
|
82
82
|
name: "supply-error-card",
|
|
83
83
|
args: {
|
|
84
|
-
|
|
84
|
+
errors: []
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
//# sourceMappingURL=supply-error-card.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_index","_interopRequireDefault","require","e","__esModule","default","meta","title","component","SupplyErrorCard","args","
|
|
1
|
+
{"version":3,"names":["_index","_interopRequireDefault","require","e","__esModule","default","meta","title","component","SupplyErrorCard","args","errors","id","descricacao","argTypes","description","control","table","type","summary","parameters","notes","_default","exports","Default","name","mensagem","SupplyErrorCardNotMessage"],"sourceRoot":"..\\..\\..\\..\\src","sources":["stories/supply-error-card/supply-error-card.stories.tsx"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAiE,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAPjE;AACA;AACA;;AAIA;;AAGA,MAAMG,IAAkC,GAAG;EACzCC,KAAK,EAAE,4BAA4B;EACnCC,SAAS,EAAEC,cAA2B;EACtCC,IAAI,EAAE;IACJC,MAAM,EAAE,CACN;MAAEC,EAAE,EAAE,GAAG;MAAEC,WAAW,EAAE;IAAgE,CAAC,EACzF;MAAED,EAAE,EAAE,GAAG;MAAEC,WAAW,EAAE;IAAwC,CAAC,EACjE;MAAED,EAAE,EAAE,GAAG;MAAEC,WAAW,EAAE;IAAuD,CAAC;EAEpF,CAAC;EACDC,QAAQ,EAAE;IACRH,MAAM,EAAE;MACNI,WAAW,EAAE,mEAAmE;MAChFC,OAAO,EAAE,QAAQ;MACjBC,KAAK,EAAE;QACLC,IAAI,EAAE;UAAEC,OAAO,EAAE;QAA0C;MAC7D;IACF;EACF,CAAC;EACDC,UAAU,EAAE;IACVC,KAAK,EAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE;AACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlB,OAAA,GAEaC,IAAI;AAIZ,MAAMkB,OAAc,GAAAD,OAAA,CAAAC,OAAA,GAAG;EAC5BC,IAAI,EAAE,2BAA2B;EACjCf,IAAI,EAAE;IACJC,MAAM,EAAE,CACN;MAAEC,EAAE,EAAE,GAAG;MAAEc,QAAQ,EAAE;IAAgE,CAAC,EACtF;MAAEd,EAAE,EAAE,GAAG;MAAEc,QAAQ,EAAE;IAAwC,CAAC,EAC9D;MAAEd,EAAE,EAAE,GAAG;MAAEc,QAAQ,EAAE;IAAuD,CAAC;EAEjF;AACF,CAAC;AAEM,MAAMC,yBAAgC,GAAAJ,OAAA,CAAAI,yBAAA,GAAG;EAC9CF,IAAI,EAAE,mBAAmB;EACzBf,IAAI,EAAE;IAAEC,MAAM,EAAE;EAAG;AACrB,CAAC","ignoreList":[]}
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* IMPORTS
|
|
5
5
|
*/
|
|
6
6
|
import React, { forwardRef } from "react";
|
|
7
|
-
import { Image, TouchableOpacity } from "react-native";
|
|
7
|
+
import { Image, TouchableOpacity, StyleSheet } from "react-native";
|
|
8
8
|
|
|
9
9
|
// components
|
|
10
10
|
import Typography from "../typography/index.js";
|
|
11
|
+
import Box from "../box/index.js";
|
|
11
12
|
|
|
12
13
|
// icons / svg
|
|
13
14
|
import { Icons } from "../../common/icons-svg/index.js";
|
|
@@ -16,9 +17,8 @@ import { Icons } from "../../common/icons-svg/index.js";
|
|
|
16
17
|
import { asBaseComponent } from "../../@types/as-base-component.js";
|
|
17
18
|
// styles
|
|
18
19
|
import { theme } from "../../styles/theme/theme.js";
|
|
19
|
-
import { styles } from "./styles.js";
|
|
20
|
-
import {
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
+
import { styles as makeStyles } from "./styles.js";
|
|
21
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
const CapturePhoto = /*#__PURE__*/forwardRef((props, ref) => {
|
|
23
23
|
const {
|
|
24
24
|
imageComprovante,
|
|
@@ -32,56 +32,54 @@ const CapturePhoto = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
32
32
|
borderStyled,
|
|
33
33
|
color,
|
|
34
34
|
fontStyle,
|
|
35
|
-
opacity,
|
|
35
|
+
opacity = 1,
|
|
36
36
|
style,
|
|
37
37
|
smallText,
|
|
38
38
|
paddingStyle,
|
|
39
39
|
backgroundColor
|
|
40
40
|
} = props;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
height,
|
|
47
|
-
marginStyle,
|
|
48
|
-
flexStyle,
|
|
49
|
-
title,
|
|
50
|
-
borderStyled,
|
|
51
|
-
color,
|
|
52
|
-
fontStyle,
|
|
41
|
+
|
|
42
|
+
// estilos do container SEMPRE aplicados no Touchable
|
|
43
|
+
const containerStyle = {
|
|
44
|
+
width: width,
|
|
45
|
+
// aceita number | string ('48%')
|
|
46
|
+
height: height,
|
|
53
47
|
opacity,
|
|
54
|
-
smallText,
|
|
55
|
-
paddingStyle,
|
|
56
48
|
backgroundColor,
|
|
57
|
-
|
|
49
|
+
borderWidth: Number(borderStyled?.borderWidth) || 0,
|
|
50
|
+
borderColor: borderStyled?.borderColor,
|
|
51
|
+
borderRadius: Number(borderStyled?.borderRadius) || 0,
|
|
52
|
+
alignItems: flexStyle?.alignItems ?? "center",
|
|
53
|
+
justifyContent: flexStyle?.justifyContent ?? "center",
|
|
54
|
+
flexDirection: flexStyle?.flexDirection ?? "column",
|
|
55
|
+
paddingTop: paddingStyle?.paddingTop,
|
|
56
|
+
paddingBottom: paddingStyle?.paddingBottom,
|
|
57
|
+
overflow: "hidden",
|
|
58
|
+
// garante o recorte da imagem no borderRadius
|
|
59
|
+
...(marginStyle ?? {})
|
|
58
60
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
backgroundColor
|
|
82
|
-
}, style],
|
|
83
|
-
onPress: takePhotoWithImagePicker,
|
|
84
|
-
testID: testID,
|
|
61
|
+
|
|
62
|
+
// seus styles existentes (caso tenha regras adicionais)
|
|
63
|
+
const styles = makeStyles(props);
|
|
64
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
65
|
+
ref: ref,
|
|
66
|
+
activeOpacity: 0.7,
|
|
67
|
+
onPress: takePhotoWithImagePicker,
|
|
68
|
+
testID: testID,
|
|
69
|
+
style: [styles.capturePhoto, containerStyle, style] // <- container SEMPRE aqui
|
|
70
|
+
,
|
|
71
|
+
children: imageComprovante ? /*#__PURE__*/_jsx(Image, {
|
|
72
|
+
source: {
|
|
73
|
+
uri: imageComprovante
|
|
74
|
+
},
|
|
75
|
+
resizeMode: "cover"
|
|
76
|
+
// a imagem agora só preenche o container
|
|
77
|
+
,
|
|
78
|
+
style: StyleSheet.flatten([{
|
|
79
|
+
width: "100%",
|
|
80
|
+
height: "100%"
|
|
81
|
+
}])
|
|
82
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
85
83
|
children: [/*#__PURE__*/_jsx(Icons, {
|
|
86
84
|
icon: "CAMERA_PLUS",
|
|
87
85
|
size: theme.fontSizes["2xl"] || 24,
|
|
@@ -95,7 +93,9 @@ const CapturePhoto = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
95
93
|
size: fontStyle?.fontSize ? fontStyle?.fontSize : theme.fontSizes.md,
|
|
96
94
|
fontFamily: fontStyle?.fontFamily ? fontStyle?.fontFamily : theme.fonts.inter_regular_400,
|
|
97
95
|
lineHeight: fontStyle?.lineHeight ? fontStyle?.lineHeight : theme.fontSizes["2xl"],
|
|
98
|
-
letterSpacing:
|
|
96
|
+
letterSpacing:
|
|
97
|
+
// RN espera número; se "regular" for seu token, mapeie pra número no Typography
|
|
98
|
+
fontStyle?.letterSpacing ?? "regular",
|
|
99
99
|
marginTop: 8
|
|
100
100
|
})
|
|
101
101
|
}), smallText && /*#__PURE__*/_jsx(Typography, {
|
|
@@ -105,14 +105,14 @@ const CapturePhoto = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
105
105
|
size: fontStyle?.fontSize ? fontStyle?.fontSize : theme.fontSizes.sm,
|
|
106
106
|
fontFamily: fontStyle?.fontFamily ? fontStyle?.fontFamily : theme.fonts.inter_regular_400,
|
|
107
107
|
lineHeight: fontStyle?.lineHeight ? fontStyle?.lineHeight : theme.fontSizes.md,
|
|
108
|
-
letterSpacing: fontStyle?.letterSpacing
|
|
108
|
+
letterSpacing: fontStyle?.letterSpacing ?? "regular"
|
|
109
109
|
})]
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* EXPORTS
|
|
116
116
|
*/
|
|
117
117
|
export default asBaseComponent(CapturePhoto);
|
|
118
118
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","Image","TouchableOpacity","Typography","Icons","asBaseComponent","theme","styles","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","Image","TouchableOpacity","StyleSheet","Typography","Box","Icons","asBaseComponent","theme","styles","makeStyles","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","CapturePhoto","props","ref","imageComprovante","takePhotoWithImagePicker","testID","width","height","marginStyle","flexStyle","title","borderStyled","color","fontStyle","opacity","style","smallText","paddingStyle","backgroundColor","containerStyle","borderWidth","Number","borderColor","borderRadius","alignItems","justifyContent","flexDirection","paddingTop","paddingBottom","overflow","activeOpacity","onPress","capturePhoto","children","source","uri","resizeMode","flatten","icon","size","fontSizes","colorSvg","text","align","textAlign","colorText","colors","gray","fontSize","md","fontFamily","fonts","inter_regular_400","lineHeight","letterSpacing","marginTop","textSmallPhoto","sm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