@evlop/native-components 1.0.261 → 1.0.262
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAc,eAAe,EAAU,WAAW,EAAS,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAc,eAAe,EAAU,WAAW,EAAS,UAAU,EAA2C,WAAW,EAAoC,UAAU,EAAqB,eAAe,EAAW,MAAM,eAAe,CAAC;AAMrP,aAAK,eAAe,GAAG;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAE1C,aAAK,eAAe,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,GAAG;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAmChN,oBAAY,aAAa,GAAG,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAMlE,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,aAAa,CAcvD,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,qBAAqB,CAAC,aAAa,CAgC1C,CAAC;AAEb,eAAe,IAAI,CAAC"}
|
|
@@ -24,31 +24,36 @@ const styled_system_1 = require("styled-system");
|
|
|
24
24
|
const textVariant = (0, styled_system_1.variant)({
|
|
25
25
|
scale: 'textVariants',
|
|
26
26
|
});
|
|
27
|
-
const StyledText = (0, native_1.default)(react_native_1.Text)((
|
|
28
|
-
var _a, _b;
|
|
29
|
-
return ({
|
|
30
|
-
color: (_a = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _a === void 0 ? void 0 : _a['gray-900'],
|
|
31
|
-
fontWeight: (_b = theme === null || theme === void 0 ? void 0 : theme.fontWeights) === null || _b === void 0 ? void 0 : _b['gray-900'],
|
|
32
|
-
});
|
|
33
|
-
}, textVariant, (0, styled_system_1.system)({
|
|
27
|
+
const StyledText = (0, native_1.default)(react_native_1.Text)(textVariant, (0, styled_system_1.system)({
|
|
34
28
|
fontSize: {
|
|
35
29
|
property: 'lineHeight',
|
|
36
30
|
scale: 'lineHeights',
|
|
37
31
|
transform: (value, scale) => (0, lodash_1.get)(scale, value, Number.isFinite(value) ? value * 1.6 : value),
|
|
38
|
-
}
|
|
39
|
-
|
|
32
|
+
},
|
|
33
|
+
fontFamily: {
|
|
34
|
+
property: 'fontFamily',
|
|
35
|
+
scale: 'fonts',
|
|
36
|
+
transform: (value, scale) => {
|
|
37
|
+
const valueToApply = scale[value] || value;
|
|
38
|
+
if (valueToApply === 'system')
|
|
39
|
+
return;
|
|
40
|
+
return valueToApply;
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}), styled_system_1.border, styled_system_1.layout, styled_system_1.background, styled_system_1.color, styled_system_1.fontSize, styled_system_1.fontWeight, styled_system_1.lineHeight, styled_system_1.letterSpacing, styled_system_1.fontStyle, styled_system_1.textAlign, // these are typography from styled-system except fontFamily
|
|
44
|
+
styled_system_1.space, ({ fontSize, fontScale = 1, theme: { fontSize: baseFontSize }, }) => !fontSize && ({
|
|
40
45
|
fontSize: fontScale * baseFontSize,
|
|
41
46
|
}));
|
|
42
47
|
const handlebarTemplateRegex = /{{[^{}]+}}/;
|
|
43
48
|
const testHandlebarTemplate = (0, lodash_1.memoize)((content) => typeof content === 'string' && handlebarTemplateRegex.test(content));
|
|
44
49
|
const BaseText = (_a) => {
|
|
45
|
-
var { children, content = children, fontFamily = 'primary' } = _a, props = __rest(_a, ["children", "content", "fontFamily"]);
|
|
50
|
+
var { children, content = children, color = 'gray-900', fontFamily = 'primary' } = _a, props = __rest(_a, ["children", "content", "color", "fontFamily"]);
|
|
46
51
|
const isTemplate = testHandlebarTemplate(content);
|
|
47
52
|
let displayValue = content;
|
|
48
53
|
if (isTemplate) {
|
|
49
54
|
displayValue = react_1.default.createElement(commons_1.RenderTemplate, { template: content });
|
|
50
55
|
}
|
|
51
|
-
return (react_1.default.createElement(StyledText, Object.assign({ fontFamily: fontFamily }, props), displayValue));
|
|
56
|
+
return (react_1.default.createElement(StyledText, Object.assign({ color: color, fontFamily: fontFamily }, props), displayValue));
|
|
52
57
|
};
|
|
53
58
|
exports.BaseText = BaseText;
|
|
54
59
|
exports.Text = (0, commons_1.withSettings)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAKwB;AACxB,mCAAsC;AACtC,kDAA0B;AAC1B,+CAAwE;AACxE,sEAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAKwB;AACxB,mCAAsC;AACtC,kDAA0B;AAC1B,+CAAwE;AACxE,sEAA8C;AAC9C,iDAAqP;AAErP,MAAM,WAAW,GAAG,IAAA,uBAAO,EAAC;IA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AAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,CAAA,EAAE,CAAA,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;YAC/J,IAAI,EAAE,QAAQ;SACf;QACD;YACE,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE;gBACP,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAC;gBAC9B,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAC;gBAClC,EAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAC;gBAChC,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAC;aACrC;YACD,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC,CAAC,gBAAQ,CAAC,CAAC;AAEb,kBAAe,YAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAc,eAAe,EAAU,WAAW,EAAS,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAc,eAAe,EAAU,WAAW,EAAS,UAAU,EAA2C,WAAW,EAAoC,UAAU,EAAqB,eAAe,EAAW,MAAM,eAAe,CAAC;AAMrP,aAAK,eAAe,GAAG;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAE1C,aAAK,eAAe,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,eAAe,GAAG;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAmChN,oBAAY,aAAa,GAAG,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAMlE,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,aAAa,CAcvD,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,qBAAqB,CAAC,aAAa,CAgC1C,CAAC;AAEb,eAAe,IAAI,CAAC"}
|