@proximus/lavender-topnavigation-native 0.1.0-alpha.0 → 0.1.0-alpha.2
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 +10 -0
- package/dist/PxTopNavigation.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/PxTopNavigation.tsx +20 -21
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.2](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-topnavigation-native@0.1.0-alpha.1...@proximus/lavender-topnavigation-native@0.1.0-alpha.2) (2025-09-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @proximus/lavender-topnavigation-native
|
|
9
|
+
|
|
10
|
+
# [0.1.0-alpha.1](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-topnavigation-native@0.1.0-alpha.0...@proximus/lavender-topnavigation-native@0.1.0-alpha.1) (2025-09-05)
|
|
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
|
+
|
|
6
16
|
# 0.1.0-alpha.0 (2025-08-14)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PxTopNavigation.d.ts","sourceRoot":"","sources":["../src/PxTopNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAGT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PxTopNavigation.d.ts","sourceRoot":"","sources":["../src/PxTopNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAGT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAA8B,MAAM,OAAO,CAAC;AAyBnD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACtC;AA8HD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAqB1D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-topnavigation-native",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "Lavender react native top navigation component",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"react-native-gesture-handler": "*"
|
|
19
19
|
},
|
|
20
20
|
"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.
|
|
21
|
+
"@proximus/lavender-common-native": "0.1.0-alpha.3",
|
|
22
|
+
"@proximus/lavender-icon-native": "0.1.0-alpha.3",
|
|
23
|
+
"@proximus/lavender-styling-native": "0.1.0-alpha.2",
|
|
24
|
+
"@proximus/lavender-texts-native": "0.1.0-alpha.3"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "6328f584529cb675f4a2ede8ad89f31e2b3c9ffb"
|
|
41
41
|
}
|
package/src/PxTopNavigation.tsx
CHANGED
|
@@ -9,15 +9,9 @@ import React, { useEffect, useState } from 'react';
|
|
|
9
9
|
import LinearGradient from 'react-native-linear-gradient';
|
|
10
10
|
import { a11y } from '@proximus/lavender-common-native';
|
|
11
11
|
import { Body, Header as TextHeader } from '@proximus/lavender-texts-native';
|
|
12
|
-
import { Colors } from '@proximus/lavender-styling-native';
|
|
13
12
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
14
13
|
import { PxIcon } from '@proximus/lavender-icon-native';
|
|
15
|
-
import {
|
|
16
|
-
BackgroundColorActionNeutralDefault,
|
|
17
|
-
BorderColorActionNeutralDefault,
|
|
18
|
-
IconColorActionBrandDefault,
|
|
19
|
-
BorderSizeM,
|
|
20
|
-
} from '@proximus/lavender-styling/dist/js/proximus/themesTokens.js';
|
|
14
|
+
import { useTheme } from '@proximus/lavender-styling-native';
|
|
21
15
|
|
|
22
16
|
function isWhiteColor(color: string | number | undefined): boolean {
|
|
23
17
|
if (!color) return false;
|
|
@@ -33,7 +27,7 @@ function isWhiteColor(color: string | number | undefined): boolean {
|
|
|
33
27
|
)
|
|
34
28
|
)
|
|
35
29
|
return true;
|
|
36
|
-
return
|
|
30
|
+
return false;
|
|
37
31
|
}
|
|
38
32
|
|
|
39
33
|
export interface PxTopNavigationProps {
|
|
@@ -54,12 +48,14 @@ export interface PxTopNavigationProps {
|
|
|
54
48
|
|
|
55
49
|
function LeftComponent({
|
|
56
50
|
title,
|
|
57
|
-
titleColor
|
|
51
|
+
titleColor,
|
|
58
52
|
description,
|
|
59
53
|
prefix,
|
|
60
54
|
descriptionContent,
|
|
61
55
|
centerTitle = false,
|
|
62
56
|
}: PxTopNavigationProps) {
|
|
57
|
+
const { theme } = useTheme();
|
|
58
|
+
|
|
63
59
|
return (
|
|
64
60
|
<View style={styles.leftComponent}>
|
|
65
61
|
{prefix}
|
|
@@ -70,7 +66,7 @@ function LeftComponent({
|
|
|
70
66
|
style={[
|
|
71
67
|
styles.textHeader,
|
|
72
68
|
{
|
|
73
|
-
color: titleColor,
|
|
69
|
+
color: titleColor || theme.t('ColorTextBrandInverted'),
|
|
74
70
|
textAlign: centerTitle ? 'center' : 'left',
|
|
75
71
|
},
|
|
76
72
|
]}
|
|
@@ -96,7 +92,7 @@ function LeftComponent({
|
|
|
96
92
|
style={[
|
|
97
93
|
styles.description,
|
|
98
94
|
{
|
|
99
|
-
color: titleColor,
|
|
95
|
+
color: titleColor || theme.t('ColorTextBrandInverted'),
|
|
100
96
|
textAlign: centerTitle ? 'center' : 'left',
|
|
101
97
|
},
|
|
102
98
|
]}
|
|
@@ -129,6 +125,8 @@ function Menu({ menuElement }: PxTopNavigationProps) {
|
|
|
129
125
|
function Search({ searchElement, colors }: PxTopNavigationProps) {
|
|
130
126
|
const [isWhiteBackground, setIsWhiteBackground] = useState(false);
|
|
131
127
|
|
|
128
|
+
const { theme } = useTheme();
|
|
129
|
+
|
|
132
130
|
useEffect(() => {
|
|
133
131
|
setIsWhiteBackground(
|
|
134
132
|
isWhiteColor(colors?.[0]) && isWhiteColor(colors?.[1])
|
|
@@ -139,15 +137,19 @@ function Search({ searchElement, colors }: PxTopNavigationProps) {
|
|
|
139
137
|
style={[
|
|
140
138
|
styles.search,
|
|
141
139
|
{
|
|
142
|
-
...(isWhiteBackground
|
|
143
|
-
? { backgroundColor: BackgroundColorActionNeutralDefault }
|
|
144
|
-
: {}),
|
|
145
140
|
...(isWhiteBackground
|
|
146
141
|
? {
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
backgroundColor: theme.t(
|
|
143
|
+
'ColorBackgroundContainerDefaultDefault'
|
|
144
|
+
),
|
|
145
|
+
borderColor: theme.t('ColorBorderNeutralDefault'),
|
|
146
|
+
borderWidth: theme.t('SizeBorderS').number,
|
|
149
147
|
}
|
|
150
|
-
: {
|
|
148
|
+
: {
|
|
149
|
+
backgroundColor: theme.t(
|
|
150
|
+
'ColorBackgroundContainerLightDefault'
|
|
151
|
+
),
|
|
152
|
+
}),
|
|
151
153
|
},
|
|
152
154
|
]}
|
|
153
155
|
>
|
|
@@ -156,7 +158,7 @@ function Search({ searchElement, colors }: PxTopNavigationProps) {
|
|
|
156
158
|
size={24}
|
|
157
159
|
color={
|
|
158
160
|
isWhiteBackground || !colors?.[0]
|
|
159
|
-
?
|
|
161
|
+
? theme.t('ColorIconBrandDefault')
|
|
160
162
|
: (colors?.[0] as string)
|
|
161
163
|
}
|
|
162
164
|
accessible={false}
|
|
@@ -209,11 +211,9 @@ const styles = StyleSheet.create({
|
|
|
209
211
|
margin: 8,
|
|
210
212
|
},
|
|
211
213
|
textHeader: {
|
|
212
|
-
color: Colors.v8_1.white,
|
|
213
214
|
fontSize: 16,
|
|
214
215
|
},
|
|
215
216
|
description: {
|
|
216
|
-
color: Colors.v8_1.white,
|
|
217
217
|
fontSize: 12,
|
|
218
218
|
},
|
|
219
219
|
leftComponent: {
|
|
@@ -234,7 +234,6 @@ const styles = StyleSheet.create({
|
|
|
234
234
|
},
|
|
235
235
|
search: {
|
|
236
236
|
padding: 11,
|
|
237
|
-
backgroundColor: Colors.v8_1.white,
|
|
238
237
|
borderRadius: 12,
|
|
239
238
|
marginVertical: 8,
|
|
240
239
|
marginHorizontal: 16,
|