@evlop/native-components 1.0.200 → 1.0.202
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/dist/cjs/src/Text/index.d.ts +4 -1
- package/dist/cjs/src/Text/index.d.ts.map +1 -1
- package/dist/cjs/src/Text/index.js +12 -3
- package/dist/cjs/src/Text/index.js.map +1 -1
- package/dist/types/main.ai.d.ts +4 -1
- package/dist/types/src/Text/index.d.ts +4 -1
- package/dist/types/src/Text/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,10 @@ import { ComponentWithSettings, Theme } from '@evlop/commons';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TextProps as RNTextProps } from 'react-native';
|
|
4
4
|
import { BackgroundProps, BorderProps, ColorProps, LayoutProps, SpaceProps, TypographyProps } from 'styled-system';
|
|
5
|
-
declare type
|
|
5
|
+
declare type TextVariantProp = {
|
|
6
|
+
variant?: string;
|
|
7
|
+
};
|
|
8
|
+
declare type NativeTextProps = RNTextProps & BorderProps<Theme> & LayoutProps<Theme> & BackgroundProps<Theme> & ColorProps<Theme> & TypographyProps<Theme> & SpaceProps<Theme> & TextVariantProp & {
|
|
6
9
|
fontScale?: number;
|
|
7
10
|
};
|
|
8
11
|
export declare type BaseTextProps = NativeTextProps & {
|
|
@@ -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,EAAU,WAAW,EAAS,UAAU,EAAsB,eAAe,
|
|
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,EAAU,WAAW,EAAS,UAAU,EAAsB,eAAe,EAAW,MAAM,eAAe,CAAC;AAM1L,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;AA8BhN,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"}
|
|
@@ -21,7 +21,16 @@ const react_1 = __importDefault(require("react"));
|
|
|
21
21
|
const react_native_1 = require("react-native");
|
|
22
22
|
const native_1 = __importDefault(require("styled-components/native"));
|
|
23
23
|
const styled_system_1 = require("styled-system");
|
|
24
|
-
const
|
|
24
|
+
const textVariant = (0, styled_system_1.variant)({
|
|
25
|
+
scale: 'textVariants',
|
|
26
|
+
});
|
|
27
|
+
const StyledText = (0, native_1.default)(react_native_1.Text)(({ theme }) => {
|
|
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)({
|
|
25
34
|
fontSize: {
|
|
26
35
|
property: 'lineHeight',
|
|
27
36
|
scale: 'lineHeights',
|
|
@@ -33,13 +42,13 @@ const StyledText = (0, native_1.default)(react_native_1.Text)((0, styled_system_
|
|
|
33
42
|
const handlebarTemplateRegex = /{{[^{}]+}}/;
|
|
34
43
|
const testHandlebarTemplate = (0, lodash_1.memoize)((content) => typeof content === 'string' && handlebarTemplateRegex.test(content));
|
|
35
44
|
const BaseText = (_a) => {
|
|
36
|
-
var { children,
|
|
45
|
+
var { children, content = children } = _a, props = __rest(_a, ["children", "content"]);
|
|
37
46
|
const isTemplate = testHandlebarTemplate(content);
|
|
38
47
|
let displayValue = content;
|
|
39
48
|
if (isTemplate) {
|
|
40
49
|
displayValue = react_1.default.createElement(commons_1.RenderTemplate, { template: content });
|
|
41
50
|
}
|
|
42
|
-
return (react_1.default.createElement(StyledText, Object.assign({}, props
|
|
51
|
+
return (react_1.default.createElement(StyledText, Object.assign({}, props), displayValue));
|
|
43
52
|
};
|
|
44
53
|
exports.BaseText = BaseText;
|
|
45
54
|
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,mCA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A,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"}
|
package/dist/types/main.ai.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ interface GapProps {
|
|
|
12
12
|
}
|
|
13
13
|
type BaseFlexboxProps = RNViewProps & BorderProps<Theme> & SSFlexboxProps<Theme> & LayoutProps<Theme> & ColorProps<Theme> & BackgroundProps<Theme> & SpaceProps<Theme> & PositionProps<Theme> & GapProps;
|
|
14
14
|
declare const BaseFlexbox: React$1.ComponentType<BaseFlexboxProps>;
|
|
15
|
-
type
|
|
15
|
+
type TextVariantProp = {
|
|
16
|
+
variant?: string;
|
|
17
|
+
};
|
|
18
|
+
type NativeTextProps = RNTextProps & BorderProps<Theme> & LayoutProps<Theme> & BackgroundProps<Theme> & ColorProps<Theme> & TypographyProps<Theme> & SpaceProps<Theme> & TextVariantProp & {
|
|
16
19
|
fontScale?: number;
|
|
17
20
|
};
|
|
18
21
|
type BaseTextProps = NativeTextProps & {
|
|
@@ -2,7 +2,10 @@ import { ComponentWithSettings, Theme } from '@evlop/commons';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TextProps as RNTextProps } from 'react-native';
|
|
4
4
|
import { BackgroundProps, BorderProps, ColorProps, LayoutProps, SpaceProps, TypographyProps } from 'styled-system';
|
|
5
|
-
declare type
|
|
5
|
+
declare type TextVariantProp = {
|
|
6
|
+
variant?: string;
|
|
7
|
+
};
|
|
8
|
+
declare type NativeTextProps = RNTextProps & BorderProps<Theme> & LayoutProps<Theme> & BackgroundProps<Theme> & ColorProps<Theme> & TypographyProps<Theme> & SpaceProps<Theme> & TextVariantProp & {
|
|
6
9
|
fontScale?: number;
|
|
7
10
|
};
|
|
8
11
|
export declare type BaseTextProps = NativeTextProps & {
|
|
@@ -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,EAAU,WAAW,EAAS,UAAU,EAAsB,eAAe,
|
|
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,EAAU,WAAW,EAAS,UAAU,EAAsB,eAAe,EAAW,MAAM,eAAe,CAAC;AAM1L,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,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