@proximus/lavender-texts-native 0.1.0-alpha.1 → 0.1.0-alpha.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/dist/v8.d.ts +2 -0
- package/dist/v8.d.ts.map +1 -1
- package/dist/v8.js +69 -0
- package/package.json +8 -26
- package/CHANGELOG.md +0 -20
- package/src/v8.tsx +0 -85
- package/tsconfig.json +0 -8
- /package/{src/index.ts → dist/index.js} +0 -0
package/dist/v8.d.ts
CHANGED
|
@@ -15,8 +15,10 @@ export declare const Fonts: {
|
|
|
15
15
|
};
|
|
16
16
|
export declare function Header(props: TextProps & {
|
|
17
17
|
disabled?: boolean;
|
|
18
|
+
inverted?: boolean;
|
|
18
19
|
}): React.JSX.Element;
|
|
19
20
|
export declare function Body(props: TextProps & {
|
|
20
21
|
disabled?: boolean;
|
|
22
|
+
inverted?: boolean;
|
|
21
23
|
}): React.JSX.Element;
|
|
22
24
|
//# sourceMappingURL=v8.d.ts.map
|
package/dist/v8.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v8.d.ts","sourceRoot":"","sources":["../src/v8.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA6B,SAAS,EAAa,MAAM,cAAc,CAAC;AAQ/E,eAAO,MAAM,KAAK;;;;;;;;;;;;CAYjB,CAAC;AAiBF,wBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"v8.d.ts","sourceRoot":"","sources":["../src/v8.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA6B,SAAS,EAAa,MAAM,cAAc,CAAC;AAQ/E,eAAO,MAAM,KAAK;;;;;;;;;;;;CAYjB,CAAC;AAiBF,wBAAgB,MAAM,CACpB,KAAK,EAAE,SAAS,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,qBAyB9D;AAED,wBAAgB,IAAI,CAClB,KAAK,EAAE,SAAS,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,qBAyB9D"}
|
package/dist/v8.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, Text } from 'react-native';
|
|
3
|
+
import { useTheme } from '@proximus/lavender-styling-native';
|
|
4
|
+
const DEFAULT_HEADER_FONT_SIZE = 27;
|
|
5
|
+
const DEFAULT_BODY_FONT_SIZE = 16;
|
|
6
|
+
const LINE_HEIGHT_HEADER_RATIO = 1.3;
|
|
7
|
+
const LINE_HEIGHT_BODY_RATIO = 1.5;
|
|
8
|
+
export const Fonts = {
|
|
9
|
+
ProximusRegular: Platform.OS === 'android' ? 'Proximus-Regular' : 'Proximus',
|
|
10
|
+
ProximusRegularItalic: 'Proximus-RegularItalic',
|
|
11
|
+
ProximusBold: 'Proximus-Bold',
|
|
12
|
+
ProximusBoldItalic: 'Proximus-BoldItalic',
|
|
13
|
+
ProximusExtraBold: 'Proximus-ExtraBold',
|
|
14
|
+
ProximusLight: 'Proximus-Light',
|
|
15
|
+
ProximusLightItalic: 'Proximus-LightItalic',
|
|
16
|
+
ProximusIcons: 'PxIcon',
|
|
17
|
+
primary: 'Proximus-Regular',
|
|
18
|
+
primaryBold: 'Proximus-ExtraBold',
|
|
19
|
+
primaryLight: 'Proximus-Light',
|
|
20
|
+
};
|
|
21
|
+
function extractFontSize(style) {
|
|
22
|
+
if (Array.isArray(style)) {
|
|
23
|
+
for (const item of style) {
|
|
24
|
+
if (item?.fontSize) {
|
|
25
|
+
return item?.fontSize;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return DEFAULT_HEADER_FONT_SIZE;
|
|
29
|
+
}
|
|
30
|
+
if (typeof style === 'object') {
|
|
31
|
+
return style?.fontSize;
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
export function Header(props) {
|
|
36
|
+
const fontSize = extractFontSize(props.style) || DEFAULT_HEADER_FONT_SIZE;
|
|
37
|
+
const { theme } = useTheme();
|
|
38
|
+
const invertedSuffix = props.inverted ? 'Inverted' : 'Default';
|
|
39
|
+
return (React.createElement(Txt, { ...props, style: [
|
|
40
|
+
{
|
|
41
|
+
fontFamily: Fonts.ProximusBold,
|
|
42
|
+
color: theme.t(`ColorTextNeutral${invertedSuffix}`),
|
|
43
|
+
lineHeight: fontSize * LINE_HEIGHT_HEADER_RATIO,
|
|
44
|
+
},
|
|
45
|
+
...(Array.isArray(props.style) ? props.style : [props.style]),
|
|
46
|
+
props.disabled && {
|
|
47
|
+
color: theme.t(`ColorTextStateDisabled${invertedSuffix}`),
|
|
48
|
+
},
|
|
49
|
+
] }, props.children));
|
|
50
|
+
}
|
|
51
|
+
export function Body(props) {
|
|
52
|
+
const fontSize = extractFontSize(props.style) || DEFAULT_BODY_FONT_SIZE;
|
|
53
|
+
const { theme } = useTheme();
|
|
54
|
+
const invertedSuffix = props.inverted ? 'Inverted' : 'Default';
|
|
55
|
+
return (React.createElement(Txt, { ...props, style: [
|
|
56
|
+
{
|
|
57
|
+
fontFamily: Fonts.ProximusRegular,
|
|
58
|
+
color: theme.t(`ColorTextNeutral${invertedSuffix}`),
|
|
59
|
+
lineHeight: fontSize * LINE_HEIGHT_BODY_RATIO,
|
|
60
|
+
},
|
|
61
|
+
...(Array.isArray(props.style) ? props.style : [props.style]),
|
|
62
|
+
props.disabled && {
|
|
63
|
+
color: theme.t(`ColorTextStateDisabled${invertedSuffix}`),
|
|
64
|
+
},
|
|
65
|
+
] }, props.children));
|
|
66
|
+
}
|
|
67
|
+
function Txt(props) {
|
|
68
|
+
return React.createElement(Text, { ...props }, props.children);
|
|
69
|
+
}
|
package/package.json
CHANGED
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-texts-native",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.11",
|
|
4
4
|
"description": "Lavender Text component",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
6
9
|
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"clean": "rm -rf dist",
|
|
9
|
-
"prepublish": "yarn clean && yarn build",
|
|
10
|
-
"build": "npx tsc -p tsconfig.json"
|
|
11
|
-
},
|
|
12
10
|
"peerDependencies": {
|
|
13
|
-
"@proximus/lavender-common-native": "
|
|
14
|
-
"@proximus/lavender-styling-native": "
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@proximus/lavender-common-native": "0.1.0-alpha.1",
|
|
18
|
-
"@proximus/lavender-styling-native": "0.1.0-alpha.1"
|
|
11
|
+
"@proximus/lavender-common-native": "*",
|
|
12
|
+
"@proximus/lavender-styling-native": "*"
|
|
19
13
|
},
|
|
20
14
|
"publishConfig": {
|
|
21
15
|
"access": "public"
|
|
22
|
-
}
|
|
23
|
-
"lerna": {
|
|
24
|
-
"command": {
|
|
25
|
-
"publish": {
|
|
26
|
-
"assets": [
|
|
27
|
-
"dist",
|
|
28
|
-
"src",
|
|
29
|
-
"package.json"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"gitHead": "d422a1d369000e1e249afb26de2cef08930c2407"
|
|
16
|
+
}
|
|
35
17
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [0.1.0-alpha.1](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-texts-native@0.1.0-alpha.0...@proximus/lavender-texts-native@0.1.0-alpha.1) (2025-08-13)
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
- **BCRI-4210372:** fix types field in modules ([68ac126](https://github.com/Pxs-Corporate/react-native-lavender/commit/68ac12657112473ae9e0e683076b1d9172be9ce6))
|
|
11
|
-
|
|
12
|
-
# 0.1.0-alpha.0 (2025-08-13)
|
|
13
|
-
|
|
14
|
-
### Features
|
|
15
|
-
|
|
16
|
-
- **BCRI-3651606:** mono repo creation ([d19f852](https://github.com/Pxs-Corporate/react-native-lavender/commit/d19f852a710963ff85b1a9d31d18188217aa23ab))
|
|
17
|
-
- **BCRI-3660857:** cell components ([af9e45c](https://github.com/Pxs-Corporate/react-native-lavender/commit/af9e45cefc20d08d2338380ff4cd8cd6851abe24))
|
|
18
|
-
- **BCRI-3810979:** tile components ([46fc5c7](https://github.com/Pxs-Corporate/react-native-lavender/commit/46fc5c7a0ddff6c2db43fba0de9929626092f265))
|
|
19
|
-
- **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
|
|
20
|
-
- **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
|
package/src/v8.tsx
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Platform, StyleProp, Text, TextProps, TextStyle } from 'react-native';
|
|
3
|
-
import { Colors } from '@proximus/lavender-styling-native';
|
|
4
|
-
|
|
5
|
-
const DEFAULT_HEADER_FONT_SIZE = 27;
|
|
6
|
-
const DEFAULT_BODY_FONT_SIZE = 16;
|
|
7
|
-
const LINE_HEIGHT_HEADER_RATIO = 1.3;
|
|
8
|
-
const LINE_HEIGHT_BODY_RATIO = 1.5;
|
|
9
|
-
|
|
10
|
-
export const Fonts = {
|
|
11
|
-
ProximusRegular: Platform.OS === 'android' ? 'Proximus-Regular' : 'Proximus',
|
|
12
|
-
ProximusRegularItalic: 'Proximus-RegularItalic',
|
|
13
|
-
ProximusBold: 'Proximus-Bold',
|
|
14
|
-
ProximusBoldItalic: 'Proximus-BoldItalic',
|
|
15
|
-
ProximusExtraBold: 'Proximus-ExtraBold',
|
|
16
|
-
ProximusLight: 'Proximus-Light',
|
|
17
|
-
ProximusLightItalic: 'Proximus-LightItalic',
|
|
18
|
-
ProximusIcons: 'PxIcon',
|
|
19
|
-
primary: 'Proximus-Regular',
|
|
20
|
-
primaryBold: 'Proximus-ExtraBold',
|
|
21
|
-
primaryLight: 'Proximus-Light',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function extractFontSize(style: StyleProp<TextStyle>) {
|
|
25
|
-
if (Array.isArray(style)) {
|
|
26
|
-
for (const item of style) {
|
|
27
|
-
if ((item as TextStyle)?.fontSize) {
|
|
28
|
-
return (item as TextStyle)?.fontSize;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return DEFAULT_HEADER_FONT_SIZE;
|
|
32
|
-
}
|
|
33
|
-
if (typeof style === 'object') {
|
|
34
|
-
return style?.fontSize;
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function Header(props: TextProps & { disabled?: boolean }) {
|
|
40
|
-
const fontSize = extractFontSize(props.style) || DEFAULT_HEADER_FONT_SIZE;
|
|
41
|
-
return (
|
|
42
|
-
<Txt
|
|
43
|
-
{...props}
|
|
44
|
-
style={[
|
|
45
|
-
{
|
|
46
|
-
fontFamily: Fonts.ProximusBold,
|
|
47
|
-
color: '#252525',
|
|
48
|
-
lineHeight: fontSize * LINE_HEIGHT_HEADER_RATIO,
|
|
49
|
-
},
|
|
50
|
-
...(Array.isArray(props.style) ? props.style : [props.style]),
|
|
51
|
-
props.disabled && {
|
|
52
|
-
color: Colors.v8_1.shadesOfGrey.dark120,
|
|
53
|
-
},
|
|
54
|
-
]}
|
|
55
|
-
>
|
|
56
|
-
{props.children}
|
|
57
|
-
</Txt>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function Body(props: TextProps & { disabled?: boolean }) {
|
|
62
|
-
const fontSize = extractFontSize(props.style) || DEFAULT_BODY_FONT_SIZE;
|
|
63
|
-
return (
|
|
64
|
-
<Txt
|
|
65
|
-
{...props}
|
|
66
|
-
style={[
|
|
67
|
-
{
|
|
68
|
-
fontFamily: Fonts.ProximusRegular,
|
|
69
|
-
color: '#252525',
|
|
70
|
-
lineHeight: fontSize * LINE_HEIGHT_BODY_RATIO,
|
|
71
|
-
},
|
|
72
|
-
...(Array.isArray(props.style) ? props.style : [props.style]),
|
|
73
|
-
props.disabled && {
|
|
74
|
-
color: Colors.v8_1.shadesOfGrey.dark120,
|
|
75
|
-
},
|
|
76
|
-
]}
|
|
77
|
-
>
|
|
78
|
-
{props.children}
|
|
79
|
-
</Txt>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function Txt(props: TextProps) {
|
|
84
|
-
return <Text {...props}>{props.children}</Text>;
|
|
85
|
-
}
|
package/tsconfig.json
DELETED
|
File without changes
|