@storybook/react-native-ui 9.1.1 → 9.1.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/dist/index.js +27 -10
- package/package.json +7 -7
- package/src/MobileMenuDrawer.tsx +29 -11
package/dist/index.js
CHANGED
|
@@ -1562,16 +1562,33 @@ var import_react_native6 = require("react-native");
|
|
|
1562
1562
|
var import_react_native_reanimated2 = require("react-native-reanimated");
|
|
1563
1563
|
var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
|
|
1564
1564
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1565
|
-
var BottomSheetBackdropComponent = (backdropComponentProps) =>
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
}
|
|
1574
|
-
)
|
|
1565
|
+
var BottomSheetBackdropComponent = (backdropComponentProps) => {
|
|
1566
|
+
const androidTouchEventFix = (0, import_react_native_reanimated2.useAnimatedStyle)(() => {
|
|
1567
|
+
if (import_react_native6.Platform.OS === "android") {
|
|
1568
|
+
return {
|
|
1569
|
+
zIndex: backdropComponentProps.animatedIndex.value >= 0 ? 0 : -1
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
return {};
|
|
1573
|
+
});
|
|
1574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1575
|
+
import_bottom_sheet3.BottomSheetBackdrop,
|
|
1576
|
+
{
|
|
1577
|
+
...backdropComponentProps,
|
|
1578
|
+
appearsOnIndex: 0,
|
|
1579
|
+
disappearsOnIndex: -1,
|
|
1580
|
+
pressBehavior: "close",
|
|
1581
|
+
style: [
|
|
1582
|
+
backdropComponentProps.style,
|
|
1583
|
+
androidTouchEventFix,
|
|
1584
|
+
{
|
|
1585
|
+
backgroundColor: "rgba(0,0,0,0.5)",
|
|
1586
|
+
paddingTop: import_react_native6.Platform.OS === "android" ? 1 : void 0
|
|
1587
|
+
}
|
|
1588
|
+
]
|
|
1589
|
+
}
|
|
1590
|
+
);
|
|
1591
|
+
};
|
|
1575
1592
|
var snapPoints = ["50%", "75%"];
|
|
1576
1593
|
var MobileMenuDrawer = (0, import_react16.memo)(
|
|
1577
1594
|
(0, import_react16.forwardRef)(({ children }, ref) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/jest": "^29.4.3",
|
|
52
|
-
"@types/react": "~19.
|
|
52
|
+
"@types/react": "~19.1.10",
|
|
53
53
|
"babel-jest": "^29.7.0",
|
|
54
54
|
"jest": "^29.7.0",
|
|
55
55
|
"react-test-renderer": "^19.1.0",
|
|
56
56
|
"ts-dedent": "^2.2.0",
|
|
57
57
|
"tsup": "^8.5.0",
|
|
58
|
-
"typescript": "~5.
|
|
58
|
+
"typescript": "~5.9.2"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@storybook/react": "^9.1.
|
|
62
|
-
"@storybook/react-native-theming": "^9.1.
|
|
63
|
-
"@storybook/react-native-ui-common": "^9.1.
|
|
61
|
+
"@storybook/react": "^9.1.5",
|
|
62
|
+
"@storybook/react-native-theming": "^9.1.2",
|
|
63
|
+
"@storybook/react-native-ui-common": "^9.1.2",
|
|
64
64
|
"es-toolkit": "^1.38.0",
|
|
65
65
|
"fuse.js": "^7.0.0",
|
|
66
66
|
"memoizerific": "^1.11.3",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "64b649172957ced2bf579305eddac3fbeddd5851"
|
|
87
87
|
}
|
package/src/MobileMenuDrawer.tsx
CHANGED
|
@@ -5,8 +5,8 @@ import BottomSheet, {
|
|
|
5
5
|
} from '@gorhom/bottom-sheet';
|
|
6
6
|
import { useTheme } from '@storybook/react-native-theming';
|
|
7
7
|
import { forwardRef, memo, ReactNode, useImperativeHandle, useMemo, useRef } from 'react';
|
|
8
|
-
import { Keyboard } from 'react-native';
|
|
9
|
-
import { useReducedMotion } from 'react-native-reanimated';
|
|
8
|
+
import { Keyboard, Platform, StyleSheet } from 'react-native';
|
|
9
|
+
import { useAnimatedStyle, useReducedMotion } from 'react-native-reanimated';
|
|
10
10
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
11
11
|
import { useSelectedNode } from './SelectedNodeProvider';
|
|
12
12
|
|
|
@@ -18,15 +18,33 @@ export interface MobileMenuDrawerRef {
|
|
|
18
18
|
setMobileMenuOpen: (isOpen: boolean) => void;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export const BottomSheetBackdropComponent = (backdropComponentProps: BottomSheetBackdropProps) =>
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
21
|
+
export const BottomSheetBackdropComponent = (backdropComponentProps: BottomSheetBackdropProps) => {
|
|
22
|
+
const androidTouchEventFix = useAnimatedStyle(() => {
|
|
23
|
+
if (Platform.OS === 'android') {
|
|
24
|
+
return {
|
|
25
|
+
zIndex: backdropComponentProps.animatedIndex.value >= 0 ? 0 : -1,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {};
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<BottomSheetBackdrop
|
|
33
|
+
{...backdropComponentProps}
|
|
34
|
+
appearsOnIndex={0}
|
|
35
|
+
disappearsOnIndex={-1}
|
|
36
|
+
pressBehavior={'close'}
|
|
37
|
+
style={[
|
|
38
|
+
backdropComponentProps.style,
|
|
39
|
+
androidTouchEventFix,
|
|
40
|
+
{
|
|
41
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
42
|
+
paddingTop: Platform.OS === 'android' ? 1 : undefined,
|
|
43
|
+
},
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
30
48
|
|
|
31
49
|
const snapPoints = ['50%', '75%'];
|
|
32
50
|
|