@ledgerhq/lumen-ui-rnative 0.0.73 → 0.0.75
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/BaseInput/BaseInput.js +2 -2
- package/dist/src/lib/Components/CardButton/CardButton.js +2 -2
- 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/BaseInput/BaseInput.tsx +2 -2
- package/src/lib/Components/CardButton/CardButton.tsx +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.74",
|
|
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": [
|
|
@@ -82,6 +82,7 @@ const useStyles = ({ hasError, isFocused, isEditable, hasLabel, }) => {
|
|
|
82
82
|
overflow: 'hidden',
|
|
83
83
|
},
|
|
84
84
|
hasError && {
|
|
85
|
+
borderWidth: 1,
|
|
85
86
|
borderColor: t.colors.border.error,
|
|
86
87
|
},
|
|
87
88
|
!isEditable && {
|
|
@@ -99,8 +100,7 @@ const useStyles = ({ hasError, isFocused, isEditable, hasLabel, }) => {
|
|
|
99
100
|
width: t.sizes.full,
|
|
100
101
|
color: t.colors.text.base,
|
|
101
102
|
backgroundColor: t.colors.bg.muted,
|
|
102
|
-
|
|
103
|
-
outlineColor: 'transparent',
|
|
103
|
+
outline: 'none',
|
|
104
104
|
},
|
|
105
105
|
hasLabel && {
|
|
106
106
|
paddingTop: t.spacings.s16,
|
|
@@ -6,11 +6,11 @@ import { Pressable } from '../Utility';
|
|
|
6
6
|
const useStyles = ({ appearance, disabled, pressed, }) => {
|
|
7
7
|
return useStyleSheet((t) => {
|
|
8
8
|
const bgColors = {
|
|
9
|
-
base: t.colors.bg.
|
|
9
|
+
base: t.colors.bg.surface,
|
|
10
10
|
outline: 'transparent',
|
|
11
11
|
};
|
|
12
12
|
const pressedBgColors = {
|
|
13
|
-
base: t.colors.bg.
|
|
13
|
+
base: t.colors.bg.surfacePressed,
|
|
14
14
|
outline: t.colors.bg.baseTransparentPressed,
|
|
15
15
|
};
|
|
16
16
|
return {
|
|
@@ -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.75",
|
|
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": [
|
|
@@ -192,6 +192,7 @@ const useStyles = ({
|
|
|
192
192
|
overflow: 'hidden',
|
|
193
193
|
},
|
|
194
194
|
hasError && {
|
|
195
|
+
borderWidth: 1,
|
|
195
196
|
borderColor: t.colors.border.error,
|
|
196
197
|
},
|
|
197
198
|
!isEditable && {
|
|
@@ -209,8 +210,7 @@ const useStyles = ({
|
|
|
209
210
|
width: t.sizes.full,
|
|
210
211
|
color: t.colors.text.base,
|
|
211
212
|
backgroundColor: t.colors.bg.muted,
|
|
212
|
-
|
|
213
|
-
outlineColor: 'transparent',
|
|
213
|
+
outline: 'none',
|
|
214
214
|
},
|
|
215
215
|
hasLabel && {
|
|
216
216
|
paddingTop: t.spacings.s16,
|
|
@@ -19,12 +19,12 @@ const useStyles = ({
|
|
|
19
19
|
return useStyleSheet(
|
|
20
20
|
(t) => {
|
|
21
21
|
const bgColors: Record<Appearance, string> = {
|
|
22
|
-
base: t.colors.bg.
|
|
22
|
+
base: t.colors.bg.surface,
|
|
23
23
|
outline: 'transparent',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const pressedBgColors: Record<Appearance, string> = {
|
|
27
|
-
base: t.colors.bg.
|
|
27
|
+
base: t.colors.bg.surfacePressed,
|
|
28
28
|
outline: t.colors.bg.baseTransparentPressed,
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -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: {
|