@ledgerhq/lumen-ui-rnative 0.0.73 → 0.0.74
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/.storybook/main.ts +1 -1
- package/.storybook/mocks/blur.tsx +14 -3
- package/dist/package.json +4 -4
- package/dist/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
- package/dist/src/lib/Components/TabBar/TabBar.js +5 -2
- package/jest.config.ts +1 -0
- package/package.json +2 -2
- package/src/lib/Components/TabBar/TabBar.mdx +1 -1
- package/src/lib/Components/TabBar/TabBar.tsx +8 -2
package/.storybook/main.ts
CHANGED
|
@@ -28,7 +28,7 @@ const config: StorybookConfig = {
|
|
|
28
28
|
...config.resolve.alias,
|
|
29
29
|
'react-native': 'react-native-web',
|
|
30
30
|
'react-native-svg': 'react-native-svg-web',
|
|
31
|
-
'@react-native-
|
|
31
|
+
'@sbaiahmed1/react-native-blur': fileURLToPath(
|
|
32
32
|
new URL('./mocks/blur.tsx', import.meta.url),
|
|
33
33
|
),
|
|
34
34
|
};
|
|
@@ -2,9 +2,20 @@ import { View, ViewProps } from 'react-native';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Mock BlurView for web/storybook
|
|
5
|
-
* @react-native-
|
|
5
|
+
* @sbaiahmed1/react-native-blur doesn't work on web, so we use a simple View
|
|
6
6
|
*/
|
|
7
|
-
export const BlurView = (
|
|
8
|
-
|
|
7
|
+
export const BlurView = (
|
|
8
|
+
props: ViewProps & {
|
|
9
|
+
blurAmount?: number;
|
|
10
|
+
blurType?: string;
|
|
11
|
+
overlayColor?: string;
|
|
12
|
+
},
|
|
13
|
+
) => {
|
|
14
|
+
const {
|
|
15
|
+
blurAmount: _blurAmount,
|
|
16
|
+
blurType: _blurType,
|
|
17
|
+
overlayColor: _overlayColor,
|
|
18
|
+
...restProps
|
|
19
|
+
} = props;
|
|
9
20
|
return <View {...restProps} />;
|
|
10
21
|
};
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-rnative",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"./styles": "./src/styles/index.ts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@ledgerhq/lumen-utils-shared": "0.0.
|
|
30
|
+
"@ledgerhq/lumen-utils-shared": "0.0.20",
|
|
31
31
|
"i18next": "^23.7.0",
|
|
32
32
|
"react-i18next": "^14.0.0"
|
|
33
33
|
},
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@types/react": "^19.0.0",
|
|
39
39
|
"@gorhom/bottom-sheet": "^5.0.0",
|
|
40
|
-
"@ledgerhq/lumen-design-core": "0.0.
|
|
40
|
+
"@ledgerhq/lumen-design-core": "0.0.53",
|
|
41
41
|
"react": "^19.0.0",
|
|
42
42
|
"react-native": "~0.79.7",
|
|
43
43
|
"react-native-reanimated": "^3.0.0",
|
|
44
44
|
"react-native-safe-area-context": "^4.0.0 || ^5.0.0",
|
|
45
45
|
"react-native-svg": "^15.0.0",
|
|
46
|
-
"@react-native-
|
|
46
|
+
"@sbaiahmed1/react-native-blur": "^4.5.5"
|
|
47
47
|
},
|
|
48
48
|
"nx": {
|
|
49
49
|
"tags": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/TabBar/TabBar.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,cAAc,KAAK,CAAC;AAGjC;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,IAAI,EACJ,UAAU,GACX,EAAE,eAAe,2CA+FjB;yBApGe,UAAU;;;AAwG1B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/TabBar/TabBar.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,cAAc,KAAK,CAAC;AAGjC;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,IAAI,EACJ,UAAU,GACX,EAAE,eAAe,2CA+FjB;yBApGe,UAAU;;;AAwG1B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,2CAsFb"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { BlurView } from '@react-native-
|
|
2
|
+
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
3
3
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
4
4
|
import { StyleSheet, Text } from 'react-native';
|
|
5
5
|
import Animated, { Easing, useAnimatedStyle, useSharedValue, withDelay, withSequence, withTiming, } from 'react-native-reanimated';
|
|
@@ -127,7 +127,9 @@ export function TabBar({ active, onTabPress, children, ...props }) {
|
|
|
127
127
|
width: itemWidth.value,
|
|
128
128
|
height: itemHeight.value - PILL_INSET * 2,
|
|
129
129
|
}), [pillProgress, itemWidth, itemHeight]);
|
|
130
|
-
return (_jsx(TabBarContextProvider, { value: { active, onTabPress: handleTabPress }, children: _jsxs(Box, { style: styles.container, onLayout: onLayout, accessibilityRole: 'tablist', ...props, children: [children, _jsx(BlurView, { style: styles.blur, blurAmount: theme.blur.
|
|
130
|
+
return (_jsx(TabBarContextProvider, { value: { active, onTabPress: handleTabPress }, children: _jsxs(Box, { style: styles.container, onLayout: onLayout, accessibilityRole: 'tablist', ...props, children: [children, _jsx(BlurView, { style: styles.blur, blurAmount: theme.blur.lg, blurType: colorScheme === 'dark' ? 'dark' : 'light', overlayColor: colorScheme === 'dark'
|
|
131
|
+
? 'rgba(0,0,0,0.15)'
|
|
132
|
+
: 'rgba(255,255,255,0.2)' }), _jsx(Animated.View, { style: [styles.pill, animatedPillStyle] })] }) }));
|
|
131
133
|
}
|
|
132
134
|
const useStyles = () => useStyleSheet((t) => ({
|
|
133
135
|
container: {
|
|
@@ -142,6 +144,7 @@ const useStyles = () => useStyleSheet((t) => ({
|
|
|
142
144
|
},
|
|
143
145
|
blur: {
|
|
144
146
|
...StyleSheet.absoluteFillObject,
|
|
147
|
+
bottom: -2,
|
|
145
148
|
zIndex: -1,
|
|
146
149
|
},
|
|
147
150
|
item: {
|
package/jest.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-rnative",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.74",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react-native-reanimated": "^3.0.0",
|
|
44
44
|
"react-native-safe-area-context": "^4.0.0 || ^5.0.0",
|
|
45
45
|
"react-native-svg": "^15.0.0",
|
|
46
|
-
"@react-native-
|
|
46
|
+
"@sbaiahmed1/react-native-blur": "^4.5.5"
|
|
47
47
|
},
|
|
48
48
|
"nx": {
|
|
49
49
|
"tags": [
|
|
@@ -17,7 +17,7 @@ import { Box } from '../Utility';
|
|
|
17
17
|
|
|
18
18
|
TabBar is an animated navigation component that allows users to switch between different pages, views and sections. It features smooth transitions, blur effects, and customizable icons for each tab. Designed specifically for React Native applications, it seamlessly integrates with React Navigation and Expo Router.
|
|
19
19
|
|
|
20
|
-
> **Note:** This component uses `react-native-reanimated` for animations and `@react-native-
|
|
20
|
+
> **Note:** This component uses `react-native-reanimated` for animations and `@sbaiahmed1/react-native-blur` for visual effects. These native libraries have limited support in web-based Storybook environments and may not render with full fidelity. For the complete experience with all animations and blur effects, please test the component in the native sandbox app on iOS or Android.
|
|
21
21
|
|
|
22
22
|
> View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=10804-1045&m=dev).
|
|
23
23
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlurView } from '@react-native-
|
|
1
|
+
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
2
2
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import { LayoutChangeEvent, StyleSheet, Text } from 'react-native';
|
|
4
4
|
import Animated, {
|
|
@@ -227,8 +227,13 @@ export function TabBar({
|
|
|
227
227
|
{children}
|
|
228
228
|
<BlurView
|
|
229
229
|
style={styles.blur}
|
|
230
|
-
blurAmount={theme.blur.
|
|
230
|
+
blurAmount={theme.blur.lg}
|
|
231
231
|
blurType={colorScheme === 'dark' ? 'dark' : 'light'}
|
|
232
|
+
overlayColor={
|
|
233
|
+
colorScheme === 'dark'
|
|
234
|
+
? 'rgba(0,0,0,0.15)'
|
|
235
|
+
: 'rgba(255,255,255,0.2)'
|
|
236
|
+
}
|
|
232
237
|
/>
|
|
233
238
|
<Animated.View style={[styles.pill, animatedPillStyle]} />
|
|
234
239
|
</Box>
|
|
@@ -251,6 +256,7 @@ const useStyles = () =>
|
|
|
251
256
|
},
|
|
252
257
|
blur: {
|
|
253
258
|
...StyleSheet.absoluteFillObject,
|
|
259
|
+
bottom: -2,
|
|
254
260
|
zIndex: -1,
|
|
255
261
|
},
|
|
256
262
|
item: {
|