@proximus/lavender-topnavigation-native 0.1.0-alpha.2 → 0.1.0-alpha.5
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/CHANGELOG.md +3 -22
- package/dist/PxTopNavigation.js +133 -0
- package/dist/far/away/package.json +36 -0
- package/dist/index.js +1 -0
- package/package.json +15 -8
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,31 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [0.1.0-alpha.
|
|
6
|
+
# [0.1.0-alpha.5](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-topnavigation-native@0.1.0-alpha.4...@proximus/lavender-topnavigation-native@0.1.0-alpha.5) (2025-09-26)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @proximus/lavender-topnavigation-native
|
|
9
9
|
|
|
10
|
-
# [0.1.0-alpha.
|
|
11
|
-
|
|
12
|
-
### Features
|
|
13
|
-
|
|
14
|
-
- **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))
|
|
15
|
-
|
|
16
|
-
# 0.1.0-alpha.0 (2025-08-14)
|
|
10
|
+
# [0.1.0-alpha.4](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-topnavigation-native@0.1.0-alpha.3...@proximus/lavender-topnavigation-native@0.1.0-alpha.4) (2025-09-25)
|
|
17
11
|
|
|
18
12
|
### Bug Fixes
|
|
19
13
|
|
|
20
|
-
- **BCRI-
|
|
21
|
-
- **BCRI-4210372:** fix types field in modules ([68ac126](https://github.com/Pxs-Corporate/react-native-lavender/commit/68ac12657112473ae9e0e683076b1d9172be9ce6))
|
|
22
|
-
- **BCRI-4210372:** topnavigation version number ([675d1c3](https://github.com/Pxs-Corporate/react-native-lavender/commit/675d1c3371d3d9505a3df5c005fc7bd47850654b))
|
|
23
|
-
|
|
24
|
-
### Features
|
|
25
|
-
|
|
26
|
-
- **BCRI-000000:** remove default E2E on DEV env build for all components ([a5d27bf](https://github.com/Pxs-Corporate/react-native-lavender/commit/a5d27bfaaebf5b75f3160f31c64b590b7bd00b93))
|
|
27
|
-
- **BCRI-3619796:** top navigation bar ([0b2bcae](https://github.com/Pxs-Corporate/react-native-lavender/commit/0b2bcaee7243b9f00f88e2b2fb97d86cf0cf5b77))
|
|
28
|
-
- **BCRI-3651772:** top navigation module ([8be234c](https://github.com/Pxs-Corporate/react-native-lavender/commit/8be234c30f8a35093ff306b25512ebf1e10e75f2))
|
|
29
|
-
- **BCRI-3660857:** cell components ([af9e45c](https://github.com/Pxs-Corporate/react-native-lavender/commit/af9e45cefc20d08d2338380ff4cd8cd6851abe24))
|
|
30
|
-
- **BCRI-3713127:** demo app ([6907714](https://github.com/Pxs-Corporate/react-native-lavender/commit/6907714ac2313813bf74657a72cf5cb10c99fec3))
|
|
31
|
-
- **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
|
|
32
|
-
- **BCRI-4002610:** update package versions and add new dependencies for styling and icon handling ([bd36e12](https://github.com/Pxs-Corporate/react-native-lavender/commit/bd36e120c36fd33602f441ceed5f41f15f81f0ea))
|
|
33
|
-
- **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
|
|
14
|
+
- **BCRI-000000:** no free space on gh runner during build ([#27](https://github.com/Pxs-Corporate/react-native-lavender/issues/27)) ([a7c8604](https://github.com/Pxs-Corporate/react-native-lavender/commit/a7c86043b5cefcb10fd768d449c5718fbabe87ec))
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { ScrollView, StyleSheet, View, } from 'react-native';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
4
|
+
import { a11y } from '@proximus/lavender-common-native';
|
|
5
|
+
import { Body, Header as TextHeader } from '@proximus/lavender-texts-native';
|
|
6
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
|
+
import { PxIcon } from '@proximus/lavender-icon-native';
|
|
8
|
+
import { useTheme } from '@proximus/lavender-styling-native';
|
|
9
|
+
function isWhiteColor(color) {
|
|
10
|
+
if (!color)
|
|
11
|
+
return false;
|
|
12
|
+
const str = color.toString().trim();
|
|
13
|
+
// Hex: #fff, #ffffff, fff, ffffff (case-insensitive)
|
|
14
|
+
if (/^#?fff(f)?(f)?$/i.test(str.replace(/^#/, '')))
|
|
15
|
+
return true;
|
|
16
|
+
// RGB: rgb(255,255,255) or with spaces
|
|
17
|
+
if (/^rgb\(\s*255\s*,\s*255\s*,\s*255\s*\)$/i.test(str))
|
|
18
|
+
return true;
|
|
19
|
+
// RGBA: rgba(255,255,255,1) or with spaces, alpha 1 or 1.0 or 100%
|
|
20
|
+
if (/^rgba\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1(\.0+)?|100%|1\.0+)\s*\)$/i.test(str))
|
|
21
|
+
return true;
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
function LeftComponent({ title, titleColor, description, prefix, descriptionContent, centerTitle = false, }) {
|
|
25
|
+
const { theme } = useTheme();
|
|
26
|
+
return (React.createElement(View, { style: styles.leftComponent },
|
|
27
|
+
prefix,
|
|
28
|
+
React.createElement(View, { style: [styles.title, { flex: 1 }] },
|
|
29
|
+
React.createElement(TextHeader, { ellipsizeMode: 'tail', numberOfLines: 1, style: [
|
|
30
|
+
styles.textHeader,
|
|
31
|
+
{
|
|
32
|
+
color: titleColor || theme.t('ColorTextBrandInverted'),
|
|
33
|
+
textAlign: centerTitle ? 'center' : 'left',
|
|
34
|
+
},
|
|
35
|
+
], ...a11y({
|
|
36
|
+
accessibilityRole: 'header',
|
|
37
|
+
}) }, [title]),
|
|
38
|
+
(descriptionContent && (React.createElement(View, { style: {
|
|
39
|
+
alignItems: 'flex-start',
|
|
40
|
+
} }, descriptionContent))) ||
|
|
41
|
+
(description && (React.createElement(Body, { ellipsizeMode: 'tail', numberOfLines: 1, style: [
|
|
42
|
+
styles.description,
|
|
43
|
+
{
|
|
44
|
+
color: titleColor || theme.t('ColorTextBrandInverted'),
|
|
45
|
+
textAlign: centerTitle ? 'center' : 'left',
|
|
46
|
+
},
|
|
47
|
+
] }, description))))));
|
|
48
|
+
}
|
|
49
|
+
function RightComponent({ suffix }) {
|
|
50
|
+
return React.createElement(View, { style: styles.rightComponent }, suffix);
|
|
51
|
+
}
|
|
52
|
+
function Menu({ menuElement }) {
|
|
53
|
+
return (React.createElement(ScrollView, { horizontal: true, contentContainerStyle: styles.menu, showsHorizontalScrollIndicator: false, showsVerticalScrollIndicator: false }, menuElement));
|
|
54
|
+
}
|
|
55
|
+
function Search({ searchElement, colors }) {
|
|
56
|
+
const [isWhiteBackground, setIsWhiteBackground] = useState(false);
|
|
57
|
+
const { theme } = useTheme();
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
setIsWhiteBackground(isWhiteColor(colors?.[0]) && isWhiteColor(colors?.[1]));
|
|
60
|
+
}, [colors]);
|
|
61
|
+
return (React.createElement(View, { style: [
|
|
62
|
+
styles.search,
|
|
63
|
+
{
|
|
64
|
+
...(isWhiteBackground
|
|
65
|
+
? {
|
|
66
|
+
backgroundColor: theme.t('ColorBackgroundContainerDefaultDefault'),
|
|
67
|
+
borderColor: theme.t('ColorBorderNeutralDefault'),
|
|
68
|
+
borderWidth: theme.t('SizeBorderS').number,
|
|
69
|
+
}
|
|
70
|
+
: {
|
|
71
|
+
backgroundColor: theme.t('ColorBackgroundContainerLightDefault'),
|
|
72
|
+
}),
|
|
73
|
+
},
|
|
74
|
+
] },
|
|
75
|
+
React.createElement(PxIcon, { name: 'search', size: 24, color: isWhiteBackground || !colors?.[0]
|
|
76
|
+
? theme.t('ColorIconBrandDefault')
|
|
77
|
+
: colors?.[0], accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' }),
|
|
78
|
+
React.createElement(View, { style: { flex: 1, marginLeft: 8 } }, searchElement)));
|
|
79
|
+
}
|
|
80
|
+
export function PxTopNavigation(props) {
|
|
81
|
+
const insets = useSafeAreaInsets();
|
|
82
|
+
return (React.createElement(LinearGradient, { colors: props.colors || ['#5C2D91', '#9F3ACE'], start: { x: 0, y: 1.0 }, end: { x: 1.0, y: 1.0 }, style: props.wrapperStyle },
|
|
83
|
+
React.createElement(View, { style: [
|
|
84
|
+
{ paddingBottom: 8, paddingTop: insets.top }, // Horizontal padding is added in the children
|
|
85
|
+
] },
|
|
86
|
+
React.createElement(Header, { ...props }),
|
|
87
|
+
props.menuElement && React.createElement(Menu, { ...props }),
|
|
88
|
+
props.searchElement && React.createElement(Search, { ...props }))));
|
|
89
|
+
}
|
|
90
|
+
function Header(props) {
|
|
91
|
+
return (React.createElement(View, { style: [styles.container] },
|
|
92
|
+
React.createElement(LeftComponent, { ...props }),
|
|
93
|
+
React.createElement(RightComponent, { ...props })));
|
|
94
|
+
}
|
|
95
|
+
const styles = StyleSheet.create({
|
|
96
|
+
container: {
|
|
97
|
+
flexDirection: 'row',
|
|
98
|
+
paddingHorizontal: 8,
|
|
99
|
+
},
|
|
100
|
+
title: {
|
|
101
|
+
margin: 8,
|
|
102
|
+
},
|
|
103
|
+
textHeader: {
|
|
104
|
+
fontSize: 16,
|
|
105
|
+
},
|
|
106
|
+
description: {
|
|
107
|
+
fontSize: 12,
|
|
108
|
+
},
|
|
109
|
+
leftComponent: {
|
|
110
|
+
flex: 1,
|
|
111
|
+
flexDirection: 'row',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
justifyContent: 'flex-start',
|
|
114
|
+
},
|
|
115
|
+
rightComponent: {
|
|
116
|
+
flexDirection: 'row',
|
|
117
|
+
alignItems: 'center',
|
|
118
|
+
},
|
|
119
|
+
menu: {
|
|
120
|
+
paddingBottom: 8,
|
|
121
|
+
paddingTop: 16,
|
|
122
|
+
paddingHorizontal: 16,
|
|
123
|
+
gap: 8,
|
|
124
|
+
},
|
|
125
|
+
search: {
|
|
126
|
+
padding: 11,
|
|
127
|
+
borderRadius: 12,
|
|
128
|
+
marginVertical: 8,
|
|
129
|
+
marginHorizontal: 16,
|
|
130
|
+
flexDirection: 'row',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
},
|
|
133
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proximus/lavender-topnavigation-native",
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
|
+
"description": "Lavender react native top navigation component",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@proximus/lavender-common-native": "*",
|
|
10
|
+
"@proximus/lavender-icon-native": "*",
|
|
11
|
+
"@proximus/lavender-styling-native": "*",
|
|
12
|
+
"@proximus/lavender-texts-native": "*",
|
|
13
|
+
"react-native-gesture-handler": "*"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"lerna": {
|
|
19
|
+
"command": {
|
|
20
|
+
"publish": {
|
|
21
|
+
"assets": [
|
|
22
|
+
{
|
|
23
|
+
"from": "dist/far/away/package.json",
|
|
24
|
+
"to": "."
|
|
25
|
+
},
|
|
26
|
+
"dist/*.js",
|
|
27
|
+
"dist/*.d.ts",
|
|
28
|
+
"dist/*.d.ts.map",
|
|
29
|
+
"src",
|
|
30
|
+
"package.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
|
|
36
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PxTopNavigation } from './PxTopNavigation';
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-topnavigation-native",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
4
|
"description": "Lavender react native top navigation component",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"clean": "rm -rf dist",
|
|
10
|
-
"
|
|
10
|
+
"transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
|
|
11
|
+
"prepublish": "yarn clean && yarn transform-package-json && yarn build",
|
|
11
12
|
"build": "npx tsc -p tsconfig.json"
|
|
12
13
|
},
|
|
13
14
|
"peerDependencies": {
|
|
@@ -18,10 +19,10 @@
|
|
|
18
19
|
"react-native-gesture-handler": "*"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
|
-
"@proximus/lavender-common-native": "0.1.0-alpha.
|
|
22
|
-
"@proximus/lavender-icon-native": "0.1.0-alpha.
|
|
23
|
-
"@proximus/lavender-styling-native": "0.1.0-alpha.
|
|
24
|
-
"@proximus/lavender-texts-native": "0.1.0-alpha.
|
|
22
|
+
"@proximus/lavender-common-native": "0.1.0-alpha.6",
|
|
23
|
+
"@proximus/lavender-icon-native": "0.1.0-alpha.6",
|
|
24
|
+
"@proximus/lavender-styling-native": "0.1.0-alpha.5",
|
|
25
|
+
"@proximus/lavender-texts-native": "0.1.0-alpha.6"
|
|
25
26
|
},
|
|
26
27
|
"publishConfig": {
|
|
27
28
|
"access": "public"
|
|
@@ -30,12 +31,18 @@
|
|
|
30
31
|
"command": {
|
|
31
32
|
"publish": {
|
|
32
33
|
"assets": [
|
|
33
|
-
|
|
34
|
+
{
|
|
35
|
+
"from": "dist/far/away/package.json",
|
|
36
|
+
"to": "."
|
|
37
|
+
},
|
|
38
|
+
"dist/*.js",
|
|
39
|
+
"dist/*.d.ts",
|
|
40
|
+
"dist/*.d.ts.map",
|
|
34
41
|
"src",
|
|
35
42
|
"package.json"
|
|
36
43
|
]
|
|
37
44
|
}
|
|
38
45
|
}
|
|
39
46
|
},
|
|
40
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
|
|
41
48
|
}
|
package/tsconfig.json
CHANGED