@proximus/lavender-texts-native 0.1.0-alpha.4 → 0.1.0-beta.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/dist/v8.js +69 -0
- package/package.json +8 -26
- package/CHANGELOG.md +0 -38
- package/src/v8.tsx +0 -97
- package/tsconfig.json +0 -8
- /package/{src/index.ts → dist/index.js} +0 -0
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-
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
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.4",
|
|
18
|
-
"@proximus/lavender-styling-native": "0.1.0-alpha.3"
|
|
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": "6e9252a716a08ededdfbfd6f5b1db70ab21e026e"
|
|
16
|
+
}
|
|
35
17
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,38 +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.4](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-texts-native@0.1.0-alpha.3...@proximus/lavender-texts-native@0.1.0-alpha.4) (2025-09-19)
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
- **BCRI-4249550:** message card + tag components ([#22](https://github.com/Pxs-Corporate/react-native-lavender/issues/22)) ([39fb91c](https://github.com/Pxs-Corporate/react-native-lavender/commit/39fb91cc294a37d07e63fca2b4e993d90b867082))
|
|
11
|
-
|
|
12
|
-
# [0.1.0-alpha.3](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-texts-native@0.1.0-alpha.2...@proximus/lavender-texts-native@0.1.0-alpha.3) (2025-09-12)
|
|
13
|
-
|
|
14
|
-
### Features
|
|
15
|
-
|
|
16
|
-
- **BCRI-4217211:** card component ([#20](https://github.com/Pxs-Corporate/react-native-lavender/issues/20)) ([0287bee](https://github.com/Pxs-Corporate/react-native-lavender/commit/0287bee00a5b532403026b5a2ca0e702b70c822f))
|
|
17
|
-
|
|
18
|
-
# [0.1.0-alpha.2](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-texts-native@0.1.0-alpha.1...@proximus/lavender-texts-native@0.1.0-alpha.2) (2025-09-05)
|
|
19
|
-
|
|
20
|
-
### Features
|
|
21
|
-
|
|
22
|
-
- **BCRI-4279213:** update token architecture and component styles ([#18](https://github.com/Pxs-Corporate/react-native-lavender/issues/18)) ([2fabf41](https://github.com/Pxs-Corporate/react-native-lavender/commit/2fabf416ce069e9756daa868c3012181db87e7f5))
|
|
23
|
-
|
|
24
|
-
# [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)
|
|
25
|
-
|
|
26
|
-
### Bug Fixes
|
|
27
|
-
|
|
28
|
-
- **BCRI-4210372:** fix types field in modules ([68ac126](https://github.com/Pxs-Corporate/react-native-lavender/commit/68ac12657112473ae9e0e683076b1d9172be9ce6))
|
|
29
|
-
|
|
30
|
-
# 0.1.0-alpha.0 (2025-08-13)
|
|
31
|
-
|
|
32
|
-
### Features
|
|
33
|
-
|
|
34
|
-
- **BCRI-3651606:** mono repo creation ([d19f852](https://github.com/Pxs-Corporate/react-native-lavender/commit/d19f852a710963ff85b1a9d31d18188217aa23ab))
|
|
35
|
-
- **BCRI-3660857:** cell components ([af9e45c](https://github.com/Pxs-Corporate/react-native-lavender/commit/af9e45cefc20d08d2338380ff4cd8cd6851abe24))
|
|
36
|
-
- **BCRI-3810979:** tile components ([46fc5c7](https://github.com/Pxs-Corporate/react-native-lavender/commit/46fc5c7a0ddff6c2db43fba0de9929626092f265))
|
|
37
|
-
- **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
|
|
38
|
-
- **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
|
package/src/v8.tsx
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Platform, StyleProp, Text, TextProps, TextStyle } from 'react-native';
|
|
3
|
-
import { useTheme } 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(
|
|
40
|
-
props: TextProps & { disabled?: boolean; inverted?: boolean }
|
|
41
|
-
) {
|
|
42
|
-
const fontSize = extractFontSize(props.style) || DEFAULT_HEADER_FONT_SIZE;
|
|
43
|
-
const { theme } = useTheme();
|
|
44
|
-
|
|
45
|
-
const invertedSuffix = props.inverted ? 'Inverted' : 'Default';
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<Txt
|
|
49
|
-
{...props}
|
|
50
|
-
style={[
|
|
51
|
-
{
|
|
52
|
-
fontFamily: Fonts.ProximusBold,
|
|
53
|
-
color: theme.t(`ColorTextNeutral${invertedSuffix}`),
|
|
54
|
-
lineHeight: fontSize * LINE_HEIGHT_HEADER_RATIO,
|
|
55
|
-
},
|
|
56
|
-
...(Array.isArray(props.style) ? props.style : [props.style]),
|
|
57
|
-
props.disabled && {
|
|
58
|
-
color: theme.t(`ColorTextStateDisabled${invertedSuffix}`),
|
|
59
|
-
},
|
|
60
|
-
]}
|
|
61
|
-
>
|
|
62
|
-
{props.children}
|
|
63
|
-
</Txt>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function Body(
|
|
68
|
-
props: TextProps & { disabled?: boolean; inverted?: boolean }
|
|
69
|
-
) {
|
|
70
|
-
const fontSize = extractFontSize(props.style) || DEFAULT_BODY_FONT_SIZE;
|
|
71
|
-
const { theme } = useTheme();
|
|
72
|
-
|
|
73
|
-
const invertedSuffix = props.inverted ? 'Inverted' : 'Default';
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<Txt
|
|
77
|
-
{...props}
|
|
78
|
-
style={[
|
|
79
|
-
{
|
|
80
|
-
fontFamily: Fonts.ProximusRegular,
|
|
81
|
-
color: theme.t(`ColorTextNeutral${invertedSuffix}`),
|
|
82
|
-
lineHeight: fontSize * LINE_HEIGHT_BODY_RATIO,
|
|
83
|
-
},
|
|
84
|
-
...(Array.isArray(props.style) ? props.style : [props.style]),
|
|
85
|
-
props.disabled && {
|
|
86
|
-
color: theme.t(`ColorTextStateDisabled${invertedSuffix}`),
|
|
87
|
-
},
|
|
88
|
-
]}
|
|
89
|
-
>
|
|
90
|
-
{props.children}
|
|
91
|
-
</Txt>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function Txt(props: TextProps) {
|
|
96
|
-
return <Text {...props}>{props.children}</Text>;
|
|
97
|
-
}
|
package/tsconfig.json
DELETED
|
File without changes
|