@pagopa/io-app-design-system 5.5.0 → 5.6.0
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/contentWrapper/ContentWrapper.js +7 -6
- package/lib/commonjs/components/contentWrapper/ContentWrapper.js.map +1 -1
- package/lib/commonjs/components/featureInfo/FeatureInfo.js +34 -15
- package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/module/components/contentWrapper/ContentWrapper.js +5 -4
- package/lib/module/components/contentWrapper/ContentWrapper.js.map +1 -1
- package/lib/module/components/featureInfo/FeatureInfo.js +35 -16
- package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/typescript/components/contentWrapper/ContentWrapper.d.ts +6 -9
- package/lib/typescript/components/contentWrapper/ContentWrapper.d.ts.map +1 -1
- package/lib/typescript/components/featureInfo/FeatureInfo.d.ts +5 -4
- package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/Pictogram.d.ts +1 -2
- package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
- package/lib/typescript/components/typography/IOText.d.ts +1 -1
- package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/contentWrapper/ContentWrapper.tsx +24 -18
- package/src/components/featureInfo/FeatureInfo.tsx +44 -18
- package/src/components/pictograms/Pictogram.tsx +1 -1
- package/src/components/typography/IOText.tsx +1 -1
|
@@ -4,30 +4,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ContentWrapper = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _IOStyles = require("../../core/IOStyles");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
13
|
/**
|
|
13
14
|
`ContentWrapper` is the main wrapper of the application. It automatically sets side margins,
|
|
14
15
|
depending on the size value
|
|
15
16
|
@param {IOContentWrapper} margin
|
|
16
17
|
*/
|
|
17
|
-
const ContentWrapper = ({
|
|
18
|
+
const ContentWrapper = exports.ContentWrapper = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
18
19
|
margin = _IOStyles.IOVisualCostants.appMarginDefault,
|
|
19
20
|
style,
|
|
20
21
|
children,
|
|
21
22
|
testID,
|
|
22
23
|
...rest
|
|
23
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
24
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
24
25
|
testID: testID,
|
|
25
26
|
style: {
|
|
26
27
|
paddingHorizontal: margin,
|
|
27
28
|
...style
|
|
28
29
|
},
|
|
30
|
+
ref: ref,
|
|
29
31
|
...rest,
|
|
30
32
|
children: children
|
|
31
|
-
});
|
|
32
|
-
exports.ContentWrapper = ContentWrapper;
|
|
33
|
+
}));
|
|
33
34
|
//# sourceMappingURL=ContentWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_IOStyles","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ContentWrapper","exports","forwardRef","margin","IOVisualCostants","appMarginDefault","style","children","testID","rest","ref","jsx","View","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["components/contentWrapper/ContentWrapper.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,SAAA,GAAAF,OAAA;AAAuD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAavD;AACA;AACA;AACA;AACA;AACO,MAAMW,cAAc,GAAAC,OAAA,CAAAD,cAAA,gBAAG,IAAAE,iBAAU,EACtC,CACE;EACEC,MAAM,GAAGC,0BAAgB,CAACC,gBAAgB;EAC1CC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACN,GAAGC;AACkB,CAAC,EACxBC,GAAG,kBAEH,IAAA/B,WAAA,CAAAgC,GAAA,EAAClC,YAAA,CAAAmC,IAAI;EACHJ,MAAM,EAAEA,MAAO;EACfF,KAAK,EAAE;IACLO,iBAAiB,EAAEV,MAAM;IACzB,GAAGG;EACL,CAAE;EACFI,GAAG,EAAEA,GAAI;EAAA,GACLD,IAAI;EAAAF,QAAA,EAEPA;AAAQ,CACL,CAEV,CAAC","ignoreList":[]}
|
|
@@ -11,26 +11,44 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
const DEFAULT_ICON_SIZE = 24;
|
|
13
13
|
const DEFAULT_PICTOGRAM_SIZE = 48;
|
|
14
|
-
const renderNode = body => {
|
|
15
|
-
if (typeof body === "string") {
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BodySmall, {
|
|
17
|
-
testID: "infoScreenBody",
|
|
18
|
-
children: body
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return body;
|
|
22
|
-
};
|
|
23
14
|
const FeatureInfo = ({
|
|
24
|
-
|
|
25
|
-
pictogramName,
|
|
15
|
+
action,
|
|
26
16
|
body,
|
|
27
|
-
|
|
17
|
+
iconName,
|
|
18
|
+
pictogramProps,
|
|
19
|
+
variant = "neutral"
|
|
28
20
|
}) => {
|
|
29
21
|
const theme = (0, _core.useIOTheme)();
|
|
30
22
|
|
|
31
23
|
/* Already defined in the `BodySmall` component as a fallback value,
|
|
32
24
|
but I keep it here to avoid possible future inconsistencies. */
|
|
33
25
|
const accessibilityRole = action?.accessibilityRole ?? "link";
|
|
26
|
+
const variantMap = {
|
|
27
|
+
contrast: {
|
|
28
|
+
action: "white",
|
|
29
|
+
content: "white"
|
|
30
|
+
},
|
|
31
|
+
neutral: {
|
|
32
|
+
action: theme["interactiveElem-default"],
|
|
33
|
+
content: theme["textBody-tertiary"]
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const {
|
|
37
|
+
action: actionColor,
|
|
38
|
+
content: contentColor
|
|
39
|
+
} = variantMap[variant];
|
|
40
|
+
const FeatureInfoContent = () => {
|
|
41
|
+
if (typeof body === "string") {
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BodySmall, {
|
|
43
|
+
color: contentColor,
|
|
44
|
+
testID: "infoScreenBody",
|
|
45
|
+
children: body
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
49
|
+
children: body
|
|
50
|
+
});
|
|
51
|
+
};
|
|
34
52
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.HStack, {
|
|
35
53
|
style: {
|
|
36
54
|
alignItems: "center"
|
|
@@ -41,9 +59,9 @@ const FeatureInfo = ({
|
|
|
41
59
|
name: iconName,
|
|
42
60
|
size: DEFAULT_ICON_SIZE,
|
|
43
61
|
color: theme["icon-decorative"]
|
|
44
|
-
}),
|
|
62
|
+
}), pictogramProps && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Pictogram, {
|
|
63
|
+
...pictogramProps,
|
|
45
64
|
allowFontScaling: true,
|
|
46
|
-
name: pictogramName,
|
|
47
65
|
size: DEFAULT_PICTOGRAM_SIZE
|
|
48
66
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.VStack, {
|
|
49
67
|
allowScaleSpacing: true,
|
|
@@ -51,10 +69,11 @@ const FeatureInfo = ({
|
|
|
51
69
|
style: {
|
|
52
70
|
flexShrink: 1
|
|
53
71
|
},
|
|
54
|
-
children: [
|
|
72
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FeatureInfoContent, {}), action && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BodySmall, {
|
|
55
73
|
asLink: true,
|
|
56
74
|
weight: "Semibold",
|
|
57
75
|
onPress: action.onPress,
|
|
76
|
+
color: actionColor,
|
|
58
77
|
accessible: true,
|
|
59
78
|
importantForAccessibility: "yes",
|
|
60
79
|
accessibilityElementsHidden: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_components","_core","_jsxRuntime","e","__esModule","default","DEFAULT_ICON_SIZE","DEFAULT_PICTOGRAM_SIZE","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_components","_core","_jsxRuntime","e","__esModule","default","DEFAULT_ICON_SIZE","DEFAULT_PICTOGRAM_SIZE","FeatureInfo","action","body","iconName","pictogramProps","variant","theme","useIOTheme","accessibilityRole","variantMap","contrast","content","neutral","actionColor","contentColor","FeatureInfoContent","jsx","BodySmall","color","testID","children","Fragment","jsxs","HStack","style","alignItems","space","Icon","allowFontScaling","name","size","Pictogram","VStack","allowScaleSpacing","flexShrink","asLink","weight","onPress","accessible","importantForAccessibility","accessibilityElementsHidden","label","exports"],"sourceRoot":"../../../../src","sources":["components/featureInfo/FeatureInfo.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AAAkD,IAAAG,W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C,UAAU,EAAE;IAAS,CAAE;IAACC,KAAK,EAAE,EAAG;IAAAN,QAAA,GAChDjB,QAAQ,iBACP,IAAAT,WAAA,CAAAsB,GAAA,EAACxB,WAAA,CAAAmC,IAAI;MACHC,gBAAgB;MAChBC,IAAI,EAAE1B,QAAS;MACf2B,IAAI,EAAEhC,iBAAkB;MACxBoB,KAAK,EAAEZ,KAAK,CAAC,iBAAiB;IAAE,CACjC,CACF,EACAF,cAAc,iBACb,IAAAV,WAAA,CAAAsB,GAAA,EAACxB,WAAA,CAAAuC,SAAS;MAAA,GACJ3B,cAAc;MAClBwB,gBAAgB;MAChBE,IAAI,EAAE/B;IAAuB,CAC9B,CACF,eACD,IAAAL,WAAA,CAAA4B,IAAA,EAAC9B,WAAA,CAAAwC,MAAM;MAACC,iBAAiB;MAACP,KAAK,EAAE,CAAE;MAACF,KAAK,EAAE;QAAEU,UAAU,EAAE;MAAE,CAAE;MAAAd,QAAA,gBAC3D,IAAA1B,WAAA,CAAAsB,GAAA,EAACD,kBAAkB,IAAE,CAAC,EACrBd,MAAM,iBACL,IAAAP,WAAA,CAAAsB,GAAA,EAACxB,WAAA,CAAAyB,SAAS;QACRkB,MAAM;QACNC,MAAM,EAAC,UAAU;QACjBC,OAAO,EAAEpC,MAAM,CAACoC,OAAQ;QACxBnB,KAAK,EAAEL,WAAY;QACnByB,UAAU;QACVC,yBAAyB,EAAE,KAAM;QACjCC,2BAA2B,EAAE,KAAM;QACnChC,iBAAiB,EAAEA,iBAAkB;QAAAY,QAAA,EAEpCnB,MAAM,CAACwC;MAAK,CACJ,CACZ;IAAA,CACK,CAAC;EAAA,CACH,CAAC;AAEb,CAAC;AAACC,OAAA,CAAA1C,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from "react";
|
|
3
|
+
import React, { forwardRef } from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
import { IOVisualCostants } from "../../core/IOStyles";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -9,19 +9,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
depending on the size value
|
|
10
10
|
@param {IOContentWrapper} margin
|
|
11
11
|
*/
|
|
12
|
-
export const ContentWrapper = ({
|
|
12
|
+
export const ContentWrapper = /*#__PURE__*/forwardRef(({
|
|
13
13
|
margin = IOVisualCostants.appMarginDefault,
|
|
14
14
|
style,
|
|
15
15
|
children,
|
|
16
16
|
testID,
|
|
17
17
|
...rest
|
|
18
|
-
}) => /*#__PURE__*/_jsx(View, {
|
|
18
|
+
}, ref) => /*#__PURE__*/_jsx(View, {
|
|
19
19
|
testID: testID,
|
|
20
20
|
style: {
|
|
21
21
|
paddingHorizontal: margin,
|
|
22
22
|
...style
|
|
23
23
|
},
|
|
24
|
+
ref: ref,
|
|
24
25
|
...rest,
|
|
25
26
|
children: children
|
|
26
|
-
});
|
|
27
|
+
}));
|
|
27
28
|
//# sourceMappingURL=ContentWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","IOVisualCostants","jsx","_jsx","ContentWrapper","margin","appMarginDefault","style","children","testID","rest","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["components/contentWrapper/ContentWrapper.tsx"],"mappings":";;AAAA,OAAOA,KAAK,
|
|
1
|
+
{"version":3,"names":["React","forwardRef","View","IOVisualCostants","jsx","_jsx","ContentWrapper","margin","appMarginDefault","style","children","testID","rest","ref","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["components/contentWrapper/ContentWrapper.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAmB,OAAO;AACpD,SAASC,IAAI,QAA8B,cAAc;AAGzD,SAASC,gBAAgB,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAavD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,gBAAGL,UAAU,CACtC,CACE;EACEM,MAAM,GAAGJ,gBAAgB,CAACK,gBAAgB;EAC1CC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACN,GAAGC;AACkB,CAAC,EACxBC,GAAG,kBAEHR,IAAA,CAACH,IAAI;EACHS,MAAM,EAAEA,MAAO;EACfF,KAAK,EAAE;IACLK,iBAAiB,EAAEP,MAAM;IACzB,GAAGE;EACL,CAAE;EACFI,GAAG,EAAEA,GAAI;EAAA,GACLD,IAAI;EAAAF,QAAA,EAEPA;AAAQ,CACL,CAEV,CAAC","ignoreList":[]}
|
|
@@ -3,29 +3,47 @@
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { BodySmall, HStack, Icon, Pictogram, VStack } from "../../components";
|
|
5
5
|
import { useIOTheme } from "../../core";
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
const DEFAULT_ICON_SIZE = 24;
|
|
8
8
|
const DEFAULT_PICTOGRAM_SIZE = 48;
|
|
9
|
-
const renderNode = body => {
|
|
10
|
-
if (typeof body === "string") {
|
|
11
|
-
return /*#__PURE__*/_jsx(BodySmall, {
|
|
12
|
-
testID: "infoScreenBody",
|
|
13
|
-
children: body
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return body;
|
|
17
|
-
};
|
|
18
9
|
export const FeatureInfo = ({
|
|
19
|
-
|
|
20
|
-
pictogramName,
|
|
10
|
+
action,
|
|
21
11
|
body,
|
|
22
|
-
|
|
12
|
+
iconName,
|
|
13
|
+
pictogramProps,
|
|
14
|
+
variant = "neutral"
|
|
23
15
|
}) => {
|
|
24
16
|
const theme = useIOTheme();
|
|
25
17
|
|
|
26
18
|
/* Already defined in the `BodySmall` component as a fallback value,
|
|
27
19
|
but I keep it here to avoid possible future inconsistencies. */
|
|
28
20
|
const accessibilityRole = action?.accessibilityRole ?? "link";
|
|
21
|
+
const variantMap = {
|
|
22
|
+
contrast: {
|
|
23
|
+
action: "white",
|
|
24
|
+
content: "white"
|
|
25
|
+
},
|
|
26
|
+
neutral: {
|
|
27
|
+
action: theme["interactiveElem-default"],
|
|
28
|
+
content: theme["textBody-tertiary"]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const {
|
|
32
|
+
action: actionColor,
|
|
33
|
+
content: contentColor
|
|
34
|
+
} = variantMap[variant];
|
|
35
|
+
const FeatureInfoContent = () => {
|
|
36
|
+
if (typeof body === "string") {
|
|
37
|
+
return /*#__PURE__*/_jsx(BodySmall, {
|
|
38
|
+
color: contentColor,
|
|
39
|
+
testID: "infoScreenBody",
|
|
40
|
+
children: body
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
44
|
+
children: body
|
|
45
|
+
});
|
|
46
|
+
};
|
|
29
47
|
return /*#__PURE__*/_jsxs(HStack, {
|
|
30
48
|
style: {
|
|
31
49
|
alignItems: "center"
|
|
@@ -36,9 +54,9 @@ export const FeatureInfo = ({
|
|
|
36
54
|
name: iconName,
|
|
37
55
|
size: DEFAULT_ICON_SIZE,
|
|
38
56
|
color: theme["icon-decorative"]
|
|
39
|
-
}),
|
|
57
|
+
}), pictogramProps && /*#__PURE__*/_jsx(Pictogram, {
|
|
58
|
+
...pictogramProps,
|
|
40
59
|
allowFontScaling: true,
|
|
41
|
-
name: pictogramName,
|
|
42
60
|
size: DEFAULT_PICTOGRAM_SIZE
|
|
43
61
|
}), /*#__PURE__*/_jsxs(VStack, {
|
|
44
62
|
allowScaleSpacing: true,
|
|
@@ -46,10 +64,11 @@ export const FeatureInfo = ({
|
|
|
46
64
|
style: {
|
|
47
65
|
flexShrink: 1
|
|
48
66
|
},
|
|
49
|
-
children: [
|
|
67
|
+
children: [/*#__PURE__*/_jsx(FeatureInfoContent, {}), action && /*#__PURE__*/_jsx(BodySmall, {
|
|
50
68
|
asLink: true,
|
|
51
69
|
weight: "Semibold",
|
|
52
70
|
onPress: action.onPress,
|
|
71
|
+
color: actionColor,
|
|
53
72
|
accessible: true,
|
|
54
73
|
importantForAccessibility: "yes",
|
|
55
74
|
accessibilityElementsHidden: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","BodySmall","HStack","Icon","Pictogram","VStack","useIOTheme","jsx","_jsx","jsxs","_jsxs","DEFAULT_ICON_SIZE","DEFAULT_PICTOGRAM_SIZE","
|
|
1
|
+
{"version":3,"names":["React","BodySmall","HStack","Icon","Pictogram","VStack","useIOTheme","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_ICON_SIZE","DEFAULT_PICTOGRAM_SIZE","FeatureInfo","action","body","iconName","pictogramProps","variant","theme","accessibilityRole","variantMap","contrast","content","neutral","actionColor","contentColor","FeatureInfoContent","color","testID","children","style","alignItems","space","allowFontScaling","name","size","allowScaleSpacing","flexShrink","asLink","weight","onPress","accessible","importantForAccessibility","accessibilityElementsHidden","label"],"sourceRoot":"../../../../src","sources":["components/featureInfo/FeatureInfo.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAqB,OAAO;AAExC,SACEC,SAAS,EACTC,MAAM,EAKNC,IAAI,EACJC,SAAS,EACTC,MAAM,QACD,kBAAkB;AACzB,SAAmBC,UAAU,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AA+BlD,MAAMC,iBAAkC,GAAG,EAAE;AAC7C,MAAMC,sBAA4C,GAAG,EAAE;AAEvD,OAAO,MAAMC,WAAW,GAAGA,CAAC;EAC1BC,MAAM;EACNC,IAAI;EACJC,QAAQ;EACRC,cAAc;EACdC,OAAO,GAAG;AACM,CAAC,KAAK;EACtB,MAAMC,KAAK,GAAGf,UAAU,CAAC,CAAC;;EAE1B;AACF;EACE,MAAMgB,iBAAiB,GAAGN,MAAM,EAAEM,iBAAiB,I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,IAAA,CAACP,SAAS;QACRwC,MAAM;QACNC,MAAM,EAAC,UAAU;QACjBC,OAAO,EAAE3B,MAAM,CAAC2B,OAAQ;QACxBb,KAAK,EAAEH,WAAY;QACnBiB,UAAU;QACVC,yBAAyB,EAAE,KAAM;QACjCC,2BAA2B,EAAE,KAAM;QACnCxB,iBAAiB,EAAEA,iBAAkB;QAAAU,QAAA,EAEpChB,MAAM,CAAC+B;MAAK,CACJ,CACZ;IAAA,CACK,CAAC;EAAA,CACH,CAAC;AAEb,CAAC","ignoreList":[]}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import { ViewProps, ViewStyle } from "react-native";
|
|
3
|
-
import { WithTestID } from "src/utils/types";
|
|
2
|
+
import { View, ViewProps, ViewStyle } from "react-native";
|
|
4
3
|
import type { IOAppMargin } from "../../core";
|
|
5
|
-
type IOContentWrapperProps = WithTestID<Omit<ViewProps, "style"> & {
|
|
6
|
-
margin?: IOAppMargin;
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
style?: Omit<ViewStyle, "paddingHorizontal" | "paddingLeft" | "paddingRight">;
|
|
9
|
-
}>;
|
|
10
4
|
/**
|
|
11
5
|
`ContentWrapper` is the main wrapper of the application. It automatically sets side margins,
|
|
12
6
|
depending on the size value
|
|
13
7
|
@param {IOContentWrapper} margin
|
|
14
8
|
*/
|
|
15
|
-
export declare const ContentWrapper:
|
|
16
|
-
|
|
9
|
+
export declare const ContentWrapper: React.ForwardRefExoticComponent<Omit<ViewProps, "style"> & {
|
|
10
|
+
margin?: IOAppMargin;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
style?: Omit<ViewStyle, "paddingHorizontal" | "paddingLeft" | "paddingRight">;
|
|
13
|
+
} & import("src/utils/types").TestID & React.RefAttributes<View>>;
|
|
17
14
|
//# sourceMappingURL=ContentWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/contentWrapper/ContentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ContentWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/contentWrapper/ContentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAc9C;;;;GAIG;AACH,eAAO,MAAM,cAAc;aAdd,WAAW;cACV,SAAS;YACX,IAAI,CACV,SAAS,EACT,mBAAmB,GAAG,aAAa,GAAG,cAAc,CACrD;iEAgCJ,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import { AccessibilityRole, GestureResponderEvent } from "react-native";
|
|
3
|
-
import { IOIcons,
|
|
3
|
+
import { IOIcons, IOPictogramsProps } from "../../components";
|
|
4
4
|
type PartialFeatureInfo = {
|
|
5
5
|
body?: string | ReactNode;
|
|
6
|
+
variant?: "neutral" | "contrast";
|
|
6
7
|
};
|
|
7
8
|
type FeatureInfoActionProps = {
|
|
8
9
|
action: {
|
|
@@ -15,12 +16,12 @@ type FeatureInfoActionProps = {
|
|
|
15
16
|
};
|
|
16
17
|
type FeatureInfoGraphicProps = {
|
|
17
18
|
iconName?: never;
|
|
18
|
-
|
|
19
|
+
pictogramProps: Pick<IOPictogramsProps, "name" | "pictogramStyle">;
|
|
19
20
|
} | {
|
|
20
21
|
iconName: IOIcons;
|
|
21
|
-
|
|
22
|
+
pictogramProps?: never;
|
|
22
23
|
};
|
|
23
24
|
type FeatureInfoProps = FeatureInfoGraphicProps & PartialFeatureInfo & FeatureInfoActionProps;
|
|
24
|
-
export declare const FeatureInfo: ({
|
|
25
|
+
export declare const FeatureInfo: ({ action, body, iconName, pictogramProps, variant }: FeatureInfoProps) => React.JSX.Element;
|
|
25
26
|
export {};
|
|
26
27
|
//# sourceMappingURL=FeatureInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/featureInfo/FeatureInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAIL,OAAO,EAEP,
|
|
1
|
+
{"version":3,"file":"FeatureInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/featureInfo/FeatureInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAIL,OAAO,EAEP,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;AAG1B,KAAK,kBAAkB,GAAG;IAExB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CAClC,CAAC;AAEF,KAAK,sBAAsB,GACvB;IACE,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;QAChD,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC;KACnE,CAAC;CACH,GACD;IACE,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB,CAAC;AAEN,KAAK,uBAAuB,GACxB;IACE,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,cAAc,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC;CACpE,GACD;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAElD,KAAK,gBAAgB,GAAG,uBAAuB,GAC7C,kBAAkB,GAClB,sBAAsB,CAAC;AAKzB,eAAO,MAAM,WAAW,GAAI,qDAMzB,gBAAgB,sBAuElB,CAAC"}
|
|
@@ -70,7 +70,7 @@ export declare const IOPictograms: {
|
|
|
70
70
|
};
|
|
71
71
|
export type IOPictograms = keyof typeof IOPictograms;
|
|
72
72
|
export type IOPictogramSizeScale = 48 | 64 | 72 | 80 | 120 | 180;
|
|
73
|
-
type IOPictogramsProps = {
|
|
73
|
+
export type IOPictogramsProps = {
|
|
74
74
|
name: IOPictograms;
|
|
75
75
|
pictogramStyle?: "default" | "light-content" | "dark-content";
|
|
76
76
|
size?: IOPictogramSizeScale | "100%";
|
|
@@ -92,5 +92,4 @@ export declare const IOPictogramsObject: {
|
|
|
92
92
|
readonly flyingMessage: ({ size, colorValues, ...props }: SVGPictogramProps) => React.JSX.Element;
|
|
93
93
|
};
|
|
94
94
|
export type IOPictogramsObject = keyof typeof IOPictogramsObject;
|
|
95
|
-
export {};
|
|
96
95
|
//# sourceMappingURL=Pictogram.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pictogram.d.ts","sourceRoot":"","sources":["../../../../src/components/pictograms/Pictogram.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAkHvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqExB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,YAAY,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjE,
|
|
1
|
+
{"version":3,"file":"Pictogram.d.ts","sourceRoot":"","sources":["../../../../src/components/pictograms/Pictogram.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAkHvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqExB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,YAAY,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,YAAY,CAAC;IAInB,cAAc,CAAC,EAAE,SAAS,GAAG,eAAe,GAAG,cAAc,CAAC;IAC9D,IAAI,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAAC;IACrC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AASF,eAAO,MAAM,SAAS,GAAI,4DAMvB,iBAAiB,sBAuCnB,CAAC;AAUF,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACnC,OAAO,GACP,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,UAAU,GACV,MAAM,GACN,UAAU,GACV,UAAU,GACV,SAAS,GACT,KAAK,GACL,UAAU,GACV,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,SAAS,GACT,eAAe,GACf,cAAc,GACd,WAAW,GACX,cAAc,GACd,UAAU,GACV,cAAc,GACd,MAAM,GACN,SAAS,GACT,OAAO,GACP,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,SAAS,GACT,YAAY,GACZ,cAAc,GACd,MAAM,GACN,KAAK,GACL,cAAc,GACd,MAAM,GACN,QAAQ,GACR,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,YAAY,GACZ,gBAAgB,EAClB,YAAY,CACb,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE;KAC7B,GAAG,IAAI,iBAAiB,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,iBAAiB,KAAK,GAAG,CAAC,OAAO;CA2CzE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,4DAM5B,iBAAiB,sBAuCnB,CAAC;AAOF,eAAO,MAAM,kBAAkB;;;;;;;;CAQrB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,kBAAkB,CAAC"}
|
|
@@ -35,7 +35,7 @@ export type IOTextProps = IOTextBaseProps & IOTextExcludedProps;
|
|
|
35
35
|
* can be used as links
|
|
36
36
|
*/
|
|
37
37
|
export type TypographicStyleAsLinkProps = {
|
|
38
|
-
color?:
|
|
38
|
+
color?: IOColors;
|
|
39
39
|
asLink: true;
|
|
40
40
|
onPress: (event: GestureResponderEvent) => void;
|
|
41
41
|
accessibilityRole?: Extract<AccessibilityRole, "button" | "link">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOText.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/IOText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AACnE,OAAO,EACL,iBAAiB,EAEjB,qBAAqB,EACrB,IAAI,EACJ,SAAS,EACT,IAAI,EACL,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,QAAQ,EAAc,MAAM,YAAY,CAAC;AAElD,OAAO,EACL,YAAY,EACZ,YAAY,EAGb,MAAM,mBAAmB,CAAC;AAE3B;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,SAAS,EACT,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,CACtE,CAAC;A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CAAC;CACnE,GACD;IAAE,KAAK,CAAC,EAAE,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAezC;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,oGAoElB,CAAC;AAEF,eAAO,MAAM,cAAc,4IAA2C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
1
|
+
import React, { forwardRef, ReactNode } from "react";
|
|
2
2
|
import { View, ViewProps, ViewStyle } from "react-native";
|
|
3
3
|
import { WithTestID } from "src/utils/types";
|
|
4
4
|
import type { IOAppMargin } from "../../core";
|
|
@@ -20,21 +20,27 @@ type IOContentWrapperProps = WithTestID<
|
|
|
20
20
|
depending on the size value
|
|
21
21
|
@param {IOContentWrapper} margin
|
|
22
22
|
*/
|
|
23
|
-
export const ContentWrapper = (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
export const ContentWrapper = forwardRef<View, IOContentWrapperProps>(
|
|
24
|
+
(
|
|
25
|
+
{
|
|
26
|
+
margin = IOVisualCostants.appMarginDefault,
|
|
27
|
+
style,
|
|
28
|
+
children,
|
|
29
|
+
testID,
|
|
30
|
+
...rest
|
|
31
|
+
}: IOContentWrapperProps,
|
|
32
|
+
ref
|
|
33
|
+
) => (
|
|
34
|
+
<View
|
|
35
|
+
testID={testID}
|
|
36
|
+
style={{
|
|
37
|
+
paddingHorizontal: margin,
|
|
38
|
+
...style
|
|
39
|
+
}}
|
|
40
|
+
ref={ref}
|
|
41
|
+
{...rest}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</View>
|
|
45
|
+
)
|
|
40
46
|
);
|
|
@@ -6,16 +6,17 @@ import {
|
|
|
6
6
|
IOIconSizeScale,
|
|
7
7
|
IOIcons,
|
|
8
8
|
IOPictogramSizeScale,
|
|
9
|
-
|
|
9
|
+
IOPictogramsProps,
|
|
10
10
|
Icon,
|
|
11
11
|
Pictogram,
|
|
12
12
|
VStack
|
|
13
13
|
} from "../../components";
|
|
14
|
-
import { useIOTheme } from "../../core";
|
|
14
|
+
import { IOColors, useIOTheme } from "../../core";
|
|
15
15
|
|
|
16
16
|
type PartialFeatureInfo = {
|
|
17
17
|
// Necessary to render main body with different formatting
|
|
18
18
|
body?: string | ReactNode;
|
|
19
|
+
variant?: "neutral" | "contrast";
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
type FeatureInfoActionProps =
|
|
@@ -31,8 +32,11 @@ type FeatureInfoActionProps =
|
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
type FeatureInfoGraphicProps =
|
|
34
|
-
| {
|
|
35
|
-
|
|
35
|
+
| {
|
|
36
|
+
iconName?: never;
|
|
37
|
+
pictogramProps: Pick<IOPictogramsProps, "name" | "pictogramStyle">;
|
|
38
|
+
}
|
|
39
|
+
| { iconName: IOIcons; pictogramProps?: never };
|
|
36
40
|
|
|
37
41
|
type FeatureInfoProps = FeatureInfoGraphicProps &
|
|
38
42
|
PartialFeatureInfo &
|
|
@@ -41,19 +45,12 @@ type FeatureInfoProps = FeatureInfoGraphicProps &
|
|
|
41
45
|
const DEFAULT_ICON_SIZE: IOIconSizeScale = 24;
|
|
42
46
|
const DEFAULT_PICTOGRAM_SIZE: IOPictogramSizeScale = 48;
|
|
43
47
|
|
|
44
|
-
const renderNode = (body: FeatureInfoProps["body"]) => {
|
|
45
|
-
if (typeof body === "string") {
|
|
46
|
-
return <BodySmall testID="infoScreenBody">{body}</BodySmall>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return body;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
48
|
export const FeatureInfo = ({
|
|
53
|
-
|
|
54
|
-
pictogramName,
|
|
49
|
+
action,
|
|
55
50
|
body,
|
|
56
|
-
|
|
51
|
+
iconName,
|
|
52
|
+
pictogramProps,
|
|
53
|
+
variant = "neutral"
|
|
57
54
|
}: FeatureInfoProps) => {
|
|
58
55
|
const theme = useIOTheme();
|
|
59
56
|
|
|
@@ -61,6 +58,34 @@ export const FeatureInfo = ({
|
|
|
61
58
|
but I keep it here to avoid possible future inconsistencies. */
|
|
62
59
|
const accessibilityRole = action?.accessibilityRole ?? "link";
|
|
63
60
|
|
|
61
|
+
const variantMap: Record<
|
|
62
|
+
NonNullable<FeatureInfoProps["variant"]>,
|
|
63
|
+
{ action: IOColors; content: IOColors }
|
|
64
|
+
> = {
|
|
65
|
+
contrast: {
|
|
66
|
+
action: "white",
|
|
67
|
+
content: "white"
|
|
68
|
+
},
|
|
69
|
+
neutral: {
|
|
70
|
+
action: theme["interactiveElem-default"],
|
|
71
|
+
content: theme["textBody-tertiary"]
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const { action: actionColor, content: contentColor } = variantMap[variant];
|
|
76
|
+
|
|
77
|
+
const FeatureInfoContent = () => {
|
|
78
|
+
if (typeof body === "string") {
|
|
79
|
+
return (
|
|
80
|
+
<BodySmall color={contentColor} testID="infoScreenBody">
|
|
81
|
+
{body}
|
|
82
|
+
</BodySmall>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return <>{body}</>;
|
|
87
|
+
};
|
|
88
|
+
|
|
64
89
|
return (
|
|
65
90
|
<HStack style={{ alignItems: "center" }} space={24}>
|
|
66
91
|
{iconName && (
|
|
@@ -71,20 +96,21 @@ export const FeatureInfo = ({
|
|
|
71
96
|
color={theme["icon-decorative"]}
|
|
72
97
|
/>
|
|
73
98
|
)}
|
|
74
|
-
{
|
|
99
|
+
{pictogramProps && (
|
|
75
100
|
<Pictogram
|
|
101
|
+
{...pictogramProps}
|
|
76
102
|
allowFontScaling
|
|
77
|
-
name={pictogramName}
|
|
78
103
|
size={DEFAULT_PICTOGRAM_SIZE}
|
|
79
104
|
/>
|
|
80
105
|
)}
|
|
81
106
|
<VStack allowScaleSpacing space={4} style={{ flexShrink: 1 }}>
|
|
82
|
-
|
|
107
|
+
<FeatureInfoContent />
|
|
83
108
|
{action && (
|
|
84
109
|
<BodySmall
|
|
85
110
|
asLink
|
|
86
111
|
weight="Semibold"
|
|
87
112
|
onPress={action.onPress}
|
|
113
|
+
color={actionColor}
|
|
88
114
|
accessible
|
|
89
115
|
importantForAccessibility={"yes"}
|
|
90
116
|
accessibilityElementsHidden={false}
|
|
@@ -189,7 +189,7 @@ export type IOPictograms = keyof typeof IOPictograms;
|
|
|
189
189
|
|
|
190
190
|
export type IOPictogramSizeScale = 48 | 64 | 72 | 80 | 120 | 180;
|
|
191
191
|
|
|
192
|
-
type IOPictogramsProps = {
|
|
192
|
+
export type IOPictogramsProps = {
|
|
193
193
|
name: IOPictograms;
|
|
194
194
|
/* Not too happy about the API choice,
|
|
195
195
|
but at least we have the same <StatusBar …>
|
|
@@ -59,7 +59,7 @@ export type IOTextProps = IOTextBaseProps & IOTextExcludedProps;
|
|
|
59
59
|
*/
|
|
60
60
|
export type TypographicStyleAsLinkProps =
|
|
61
61
|
| {
|
|
62
|
-
color?:
|
|
62
|
+
color?: IOColors;
|
|
63
63
|
asLink: true;
|
|
64
64
|
onPress: (event: GestureResponderEvent) => void;
|
|
65
65
|
accessibilityRole?: Extract<AccessibilityRole, "button" | "link">;
|