@storybook/react-native-ui-lite 10.0.0-beta.9 → 10.0.0-rc.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 +34 -12
- package/package.json +7 -6
- package/src/Layout.tsx +17 -16
- package/src/MobileAddonsPanel.tsx +12 -8
- package/src/MobileMenuDrawer.tsx +40 -44
- package/src/Search.tsx +9 -3
- package/src/SearchResults.stories.tsx +4 -0
- package/src/Tree.stories.tsx +2 -0
package/dist/index.js
CHANGED
|
@@ -920,7 +920,8 @@ var SearchField = import_react_native_theming5.styled.View({
|
|
|
920
920
|
position: "relative"
|
|
921
921
|
});
|
|
922
922
|
var Input = (0, import_react_native_theming5.styled)(import_react_native3.TextInput)(({ theme }) => ({
|
|
923
|
-
height: 32,
|
|
923
|
+
height: import_react_native3.Platform.OS === "android" ? "auto" : 32,
|
|
924
|
+
minHeight: 32,
|
|
924
925
|
paddingLeft: 28,
|
|
925
926
|
paddingRight: 28,
|
|
926
927
|
borderWidth: 1,
|
|
@@ -1043,7 +1044,15 @@ var Search = import_react8.default.memo(function Search2({ children, dataset, se
|
|
|
1043
1044
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native3.View, { style: { flex: 1 }, children: [
|
|
1044
1045
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(SearchField, { children: [
|
|
1045
1046
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SearchIconWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SearchIcon, {}) }),
|
|
1046
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1047
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1048
|
+
Input,
|
|
1049
|
+
{
|
|
1050
|
+
ref: inputRef,
|
|
1051
|
+
onChangeText: setInputValue,
|
|
1052
|
+
onFocus: () => setIsOpen(true),
|
|
1053
|
+
returnKeyType: "search"
|
|
1054
|
+
}
|
|
1055
|
+
),
|
|
1047
1056
|
isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1048
1057
|
ClearIcon,
|
|
1049
1058
|
{
|
|
@@ -1372,6 +1381,7 @@ function useAnimatedValue(initialValue, config) {
|
|
|
1372
1381
|
}
|
|
1373
1382
|
|
|
1374
1383
|
// src/MobileAddonsPanel.tsx
|
|
1384
|
+
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
1375
1385
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1376
1386
|
var MobileAddonsPanel = (0, import_react13.forwardRef)(
|
|
1377
1387
|
({ storyId }, ref) => {
|
|
@@ -1450,7 +1460,7 @@ var MobileAddonsPanel = (0, import_react13.forwardRef)(
|
|
|
1450
1460
|
transform: [{ translateY: positionBottomAnimation }]
|
|
1451
1461
|
},
|
|
1452
1462
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1453
|
-
import_react_native7.
|
|
1463
|
+
import_react_native7.View,
|
|
1454
1464
|
{
|
|
1455
1465
|
style: {
|
|
1456
1466
|
justifyContent: "flex-end"
|
|
@@ -1508,12 +1518,10 @@ var centeredStyle = {
|
|
|
1508
1518
|
alignItems: "center",
|
|
1509
1519
|
justifyContent: "center"
|
|
1510
1520
|
};
|
|
1511
|
-
var scrollContentContainerStyle = {
|
|
1512
|
-
paddingBottom: 16
|
|
1513
|
-
};
|
|
1514
1521
|
var hitSlop = { top: 10, right: 10, bottom: 10, left: 10 };
|
|
1515
1522
|
var AddonsTabs = ({ onClose, storyId }) => {
|
|
1516
1523
|
const panels = import_manager_api.addons.getElements(import_types.Addon_TypesEnum.PANEL);
|
|
1524
|
+
const insets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
1517
1525
|
const [addonSelected, setAddonSelected] = (0, import_react13.useState)(Object.keys(panels)[0]);
|
|
1518
1526
|
const panel = (0, import_react13.useMemo)(() => {
|
|
1519
1527
|
if (!storyId) {
|
|
@@ -1524,6 +1532,12 @@ var AddonsTabs = ({ onClose, storyId }) => {
|
|
|
1524
1532
|
}
|
|
1525
1533
|
return panels[addonSelected].render({ active: true });
|
|
1526
1534
|
}, [addonSelected, panels, storyId]);
|
|
1535
|
+
const scrollContentContainerStyle = (0, import_react_native_ui_common6.useStyle)(
|
|
1536
|
+
() => ({
|
|
1537
|
+
paddingBottom: insets.bottom + 16
|
|
1538
|
+
}),
|
|
1539
|
+
[insets]
|
|
1540
|
+
);
|
|
1527
1541
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native7.View, { style: addonsTabsContainerStyle, children: [
|
|
1528
1542
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native7.View, { style: addonsTabsStyle, children: [
|
|
1529
1543
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -1652,7 +1666,7 @@ var MobileMenuDrawer = (0, import_react14.memo)(
|
|
|
1652
1666
|
transparent: true,
|
|
1653
1667
|
statusBarTranslucent: true,
|
|
1654
1668
|
onRequestClose: () => setMobileMenuOpen(false),
|
|
1655
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
1669
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native8.KeyboardAvoidingView, { behavior: "height", style: { flex: 1 }, children: [
|
|
1656
1670
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native8.View, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native8.Pressable, { style: { flex: 1 }, onPress: () => setMobileMenuOpen(false) }) }),
|
|
1657
1671
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1658
1672
|
import_react_native8.Animated.View,
|
|
@@ -1699,7 +1713,7 @@ var MobileMenuDrawer = (0, import_react14.memo)(
|
|
|
1699
1713
|
]
|
|
1700
1714
|
}
|
|
1701
1715
|
)
|
|
1702
|
-
] })
|
|
1716
|
+
] })
|
|
1703
1717
|
}
|
|
1704
1718
|
);
|
|
1705
1719
|
})
|
|
@@ -1789,6 +1803,7 @@ var StorybookLogo = ({ theme }) => {
|
|
|
1789
1803
|
};
|
|
1790
1804
|
|
|
1791
1805
|
// src/Layout.tsx
|
|
1806
|
+
var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
|
|
1792
1807
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1793
1808
|
var desktopLogoContainer = {
|
|
1794
1809
|
flexDirection: "row",
|
|
@@ -1810,7 +1825,7 @@ var mobileMenuDrawerContentStyle = {
|
|
|
1810
1825
|
paddingTop: 4,
|
|
1811
1826
|
paddingBottom: 4
|
|
1812
1827
|
};
|
|
1813
|
-
var LiteUI = ({ storage, theme, storyHash, story, children }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1828
|
+
var LiteUI = ({ storage, theme, storyHash, story, children }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native_safe_area_context2.SafeAreaProvider, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native_theming10.ThemeProvider, { theme, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native_ui_common7.StorageProvider, { storage, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native_ui_common7.LayoutProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Layout, { storyHash, story, children }) }) }) }) });
|
|
1814
1829
|
var Layout = ({
|
|
1815
1830
|
storyHash,
|
|
1816
1831
|
story,
|
|
@@ -1818,6 +1833,7 @@ var Layout = ({
|
|
|
1818
1833
|
}) => {
|
|
1819
1834
|
const theme = (0, import_react_native_theming10.useTheme)();
|
|
1820
1835
|
const { isDesktop } = (0, import_react_native_ui_common7.useLayout)();
|
|
1836
|
+
const insets = (0, import_react_native_safe_area_context2.useSafeAreaInsets)();
|
|
1821
1837
|
const [desktopSidebarOpen, setDesktopSidebarOpen] = (0, import_react_native_ui_common7.useStoreBooleanState)(
|
|
1822
1838
|
"desktopSidebarState",
|
|
1823
1839
|
true
|
|
@@ -1857,9 +1873,15 @@ var Layout = ({
|
|
|
1857
1873
|
return {
|
|
1858
1874
|
flex: 1,
|
|
1859
1875
|
backgroundColor: theme.background.content,
|
|
1860
|
-
|
|
1876
|
+
paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top
|
|
1861
1877
|
};
|
|
1862
1878
|
}, [theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
|
|
1879
|
+
const navContainerStyle = (0, import_react_native_ui_common7.useStyle)(
|
|
1880
|
+
() => ({
|
|
1881
|
+
paddingBottom: insets.bottom
|
|
1882
|
+
}),
|
|
1883
|
+
[insets.bottom]
|
|
1884
|
+
);
|
|
1863
1885
|
const fullScreenButtonStyle = (0, import_react_native_ui_common7.useStyle)(
|
|
1864
1886
|
() => ({
|
|
1865
1887
|
position: "absolute",
|
|
@@ -1886,7 +1908,7 @@ var Layout = ({
|
|
|
1886
1908
|
const channel = import_manager_api2.addons.getChannel();
|
|
1887
1909
|
channel.emit(import_core_events.SET_CURRENT_STORY, { storyId: newStoryId });
|
|
1888
1910
|
}, []);
|
|
1889
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native10.
|
|
1911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native10.View, { style: containerStyle, children: [
|
|
1890
1912
|
isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native10.View, { style: desktopSidebarStyle, children: desktopSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native10.ScrollView, { keyboardShouldPersistTaps: "handled", children: [
|
|
1891
1913
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native10.View, { style: desktopLogoContainer, children: [
|
|
1892
1914
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(StorybookLogo, { theme }),
|
|
@@ -1925,7 +1947,7 @@ var Layout = ({
|
|
|
1925
1947
|
}
|
|
1926
1948
|
) }) : null
|
|
1927
1949
|
] }),
|
|
1928
|
-
!uiHidden && !isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Container3, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Nav, { children: [
|
|
1950
|
+
!uiHidden && !isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Container3, { style: navContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Nav, { children: [
|
|
1929
1951
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1930
1952
|
Button2,
|
|
1931
1953
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui-lite",
|
|
3
|
-
"version": "10.0.0-
|
|
3
|
+
"version": "10.0.0-rc.2",
|
|
4
4
|
"description": "lightweight ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -58,18 +58,19 @@
|
|
|
58
58
|
"typescript": "~5.9.2"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@storybook/react": "10.0.0
|
|
62
|
-
"@storybook/react-native-theming": "^10.0.0-
|
|
63
|
-
"@storybook/react-native-ui-common": "^10.0.0-
|
|
61
|
+
"@storybook/react": "10.0.0",
|
|
62
|
+
"@storybook/react-native-theming": "^10.0.0-rc.2",
|
|
63
|
+
"@storybook/react-native-ui-common": "^10.0.0-rc.2",
|
|
64
64
|
"fuse.js": "^7.0.0",
|
|
65
65
|
"memoizerific": "^1.11.3",
|
|
66
66
|
"polished": "^4.3.1",
|
|
67
|
+
"react-native-safe-area-context": "^5",
|
|
67
68
|
"store2": "^2.14.3"
|
|
68
69
|
},
|
|
69
70
|
"peerDependencies": {
|
|
70
71
|
"react": "*",
|
|
71
72
|
"react-native": ">=0.57.0",
|
|
72
|
-
"storybook": ">=10 || 10.0.0-
|
|
73
|
+
"storybook": ">=10 || 10.0.0-rc.1 || ^10"
|
|
73
74
|
},
|
|
74
75
|
"engines": {
|
|
75
76
|
"node": ">=20.0.0"
|
|
@@ -77,5 +78,5 @@
|
|
|
77
78
|
"publishConfig": {
|
|
78
79
|
"access": "public"
|
|
79
80
|
},
|
|
80
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "5cf63a3b01979f229638feb68a6b4131b9e67cd3"
|
|
81
82
|
}
|
package/src/Layout.tsx
CHANGED
|
@@ -11,15 +11,7 @@ import {
|
|
|
11
11
|
useStyle,
|
|
12
12
|
} from '@storybook/react-native-ui-common';
|
|
13
13
|
import { ReactElement, ReactNode, useCallback, useRef, useState } from 'react';
|
|
14
|
-
import {
|
|
15
|
-
Platform,
|
|
16
|
-
SafeAreaView,
|
|
17
|
-
ScrollView,
|
|
18
|
-
Text,
|
|
19
|
-
TouchableOpacity,
|
|
20
|
-
View,
|
|
21
|
-
ViewStyle,
|
|
22
|
-
} from 'react-native';
|
|
14
|
+
import { Platform, ScrollView, Text, TouchableOpacity, View, ViewStyle } from 'react-native';
|
|
23
15
|
import { SET_CURRENT_STORY } from 'storybook/internal/core-events';
|
|
24
16
|
import { addons } from 'storybook/manager-api';
|
|
25
17
|
import { type API_IndexHash } from 'storybook/internal/types';
|
|
@@ -35,6 +27,7 @@ import {
|
|
|
35
27
|
FullscreenIcon,
|
|
36
28
|
MenuIcon,
|
|
37
29
|
} from './icon/iconDataUris';
|
|
30
|
+
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
38
31
|
|
|
39
32
|
const desktopLogoContainer = {
|
|
40
33
|
flexDirection: 'row',
|
|
@@ -65,9 +58,8 @@ const mobileMenuDrawerContentStyle = {
|
|
|
65
58
|
} satisfies ViewStyle;
|
|
66
59
|
|
|
67
60
|
export const LiteUI: SBUI = ({ storage, theme, storyHash, story, children }): ReactElement => (
|
|
68
|
-
|
|
61
|
+
<SafeAreaProvider style={{ flex: 1 }}>
|
|
69
62
|
<ThemeProvider theme={theme}>
|
|
70
|
-
{/* @ts-ignore something weird with story type */}
|
|
71
63
|
<StorageProvider storage={storage}>
|
|
72
64
|
<LayoutProvider>
|
|
73
65
|
<Layout storyHash={storyHash} story={story}>
|
|
@@ -76,7 +68,7 @@ export const LiteUI: SBUI = ({ storage, theme, storyHash, story, children }): Re
|
|
|
76
68
|
</LayoutProvider>
|
|
77
69
|
</StorageProvider>
|
|
78
70
|
</ThemeProvider>
|
|
79
|
-
|
|
71
|
+
</SafeAreaProvider>
|
|
80
72
|
);
|
|
81
73
|
|
|
82
74
|
export const Layout = ({
|
|
@@ -92,6 +84,8 @@ export const Layout = ({
|
|
|
92
84
|
|
|
93
85
|
const { isDesktop } = useLayout();
|
|
94
86
|
|
|
87
|
+
const insets = useSafeAreaInsets();
|
|
88
|
+
|
|
95
89
|
const [desktopSidebarOpen, setDesktopSidebarOpen] = useStoreBooleanState(
|
|
96
90
|
'desktopSidebarState',
|
|
97
91
|
true
|
|
@@ -137,10 +131,17 @@ export const Layout = ({
|
|
|
137
131
|
return {
|
|
138
132
|
flex: 1,
|
|
139
133
|
backgroundColor: theme.background.content,
|
|
140
|
-
|
|
134
|
+
paddingTop: story?.parameters?.noSafeArea ? 0 : insets.top,
|
|
141
135
|
};
|
|
142
136
|
}, [theme.background.content, story?.parameters?.noSafeArea, isDesktop]);
|
|
143
137
|
|
|
138
|
+
const navContainerStyle = useStyle(
|
|
139
|
+
() => ({
|
|
140
|
+
paddingBottom: insets.bottom,
|
|
141
|
+
}),
|
|
142
|
+
[insets.bottom]
|
|
143
|
+
);
|
|
144
|
+
|
|
144
145
|
const fullScreenButtonStyle = useStyle(
|
|
145
146
|
() => ({
|
|
146
147
|
position: 'absolute',
|
|
@@ -173,7 +174,7 @@ export const Layout = ({
|
|
|
173
174
|
}, []);
|
|
174
175
|
|
|
175
176
|
return (
|
|
176
|
-
<
|
|
177
|
+
<View style={containerStyle}>
|
|
177
178
|
{isDesktop ? (
|
|
178
179
|
<View style={desktopSidebarStyle}>
|
|
179
180
|
{desktopSidebarOpen ? (
|
|
@@ -233,7 +234,7 @@ export const Layout = ({
|
|
|
233
234
|
</View>
|
|
234
235
|
|
|
235
236
|
{!uiHidden && !isDesktop ? (
|
|
236
|
-
<Container>
|
|
237
|
+
<Container style={navContainerStyle}>
|
|
237
238
|
<Nav>
|
|
238
239
|
<Button
|
|
239
240
|
testID="mobile-menu-button"
|
|
@@ -278,7 +279,7 @@ export const Layout = ({
|
|
|
278
279
|
)}
|
|
279
280
|
|
|
280
281
|
{isDesktop ? null : <MobileAddonsPanel ref={addonPanelRef} storyId={story?.id} />}
|
|
281
|
-
</
|
|
282
|
+
</View>
|
|
282
283
|
);
|
|
283
284
|
};
|
|
284
285
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { styled, useTheme } from '@storybook/react-native-theming';
|
|
2
|
-
import { IconButton } from '@storybook/react-native-ui-common';
|
|
2
|
+
import { IconButton, useStyle } from '@storybook/react-native-ui-common';
|
|
3
3
|
import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
4
4
|
import {
|
|
5
5
|
Animated,
|
|
6
6
|
Easing,
|
|
7
7
|
Keyboard,
|
|
8
8
|
Platform,
|
|
9
|
-
SafeAreaView,
|
|
10
9
|
ScrollView,
|
|
11
10
|
StyleProp,
|
|
12
11
|
Text,
|
|
@@ -18,6 +17,7 @@ import { addons } from 'storybook/manager-api';
|
|
|
18
17
|
import { Addon_TypesEnum } from 'storybook/internal/types';
|
|
19
18
|
import { CloseIcon } from './icon/iconDataUris';
|
|
20
19
|
import useAnimatedValue from './useAnimatedValue';
|
|
20
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
21
21
|
|
|
22
22
|
export interface MobileAddonsPanelRef {
|
|
23
23
|
setAddonsPanelOpen: (isOpen: boolean) => void;
|
|
@@ -110,7 +110,7 @@ export const MobileAddonsPanel = forwardRef<MobileAddonsPanelRef, { storyId?: st
|
|
|
110
110
|
transform: [{ translateY: positionBottomAnimation }],
|
|
111
111
|
}}
|
|
112
112
|
>
|
|
113
|
-
<
|
|
113
|
+
<View
|
|
114
114
|
style={{
|
|
115
115
|
justifyContent: 'flex-end',
|
|
116
116
|
}}
|
|
@@ -132,7 +132,7 @@ export const MobileAddonsPanel = forwardRef<MobileAddonsPanelRef, { storyId?: st
|
|
|
132
132
|
storyId={storyId}
|
|
133
133
|
/>
|
|
134
134
|
</View>
|
|
135
|
-
</
|
|
135
|
+
</View>
|
|
136
136
|
</Animated.View>
|
|
137
137
|
);
|
|
138
138
|
}
|
|
@@ -170,14 +170,11 @@ const centeredStyle = {
|
|
|
170
170
|
justifyContent: 'center',
|
|
171
171
|
} satisfies StyleProp<ViewStyle>;
|
|
172
172
|
|
|
173
|
-
const scrollContentContainerStyle = {
|
|
174
|
-
paddingBottom: 16,
|
|
175
|
-
} satisfies StyleProp<ViewStyle>;
|
|
176
173
|
const hitSlop = { top: 10, right: 10, bottom: 10, left: 10 };
|
|
177
174
|
|
|
178
175
|
export const AddonsTabs = ({ onClose, storyId }: { onClose?: () => void; storyId?: string }) => {
|
|
179
176
|
const panels = addons.getElements(Addon_TypesEnum.PANEL);
|
|
180
|
-
|
|
177
|
+
const insets = useSafeAreaInsets();
|
|
181
178
|
const [addonSelected, setAddonSelected] = useState(Object.keys(panels)[0]);
|
|
182
179
|
|
|
183
180
|
const panel = useMemo(() => {
|
|
@@ -200,6 +197,13 @@ export const AddonsTabs = ({ onClose, storyId }: { onClose?: () => void; storyId
|
|
|
200
197
|
return panels[addonSelected].render({ active: true });
|
|
201
198
|
}, [addonSelected, panels, storyId]);
|
|
202
199
|
|
|
200
|
+
const scrollContentContainerStyle = useStyle(
|
|
201
|
+
() => ({
|
|
202
|
+
paddingBottom: insets.bottom + 16,
|
|
203
|
+
}),
|
|
204
|
+
[insets]
|
|
205
|
+
);
|
|
206
|
+
|
|
203
207
|
return (
|
|
204
208
|
<View style={addonsTabsContainerStyle}>
|
|
205
209
|
<View style={addonsTabsStyle}>
|
package/src/MobileMenuDrawer.tsx
CHANGED
|
@@ -8,11 +8,9 @@ import {
|
|
|
8
8
|
PanResponder,
|
|
9
9
|
PanResponderInstance,
|
|
10
10
|
Pressable,
|
|
11
|
-
SafeAreaView,
|
|
12
11
|
ScrollView,
|
|
13
12
|
View,
|
|
14
13
|
} from 'react-native';
|
|
15
|
-
|
|
16
14
|
import { useSelectedNode } from './SelectedNodeProvider';
|
|
17
15
|
import useAnimatedValue from './useAnimatedValue';
|
|
18
16
|
|
|
@@ -98,51 +96,49 @@ export const MobileMenuDrawer = memo(
|
|
|
98
96
|
onRequestClose={() => setMobileMenuOpen(false)}
|
|
99
97
|
>
|
|
100
98
|
<KeyboardAvoidingView behavior="height" style={{ flex: 1 }}>
|
|
101
|
-
<
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
</View>
|
|
99
|
+
<View style={{ flex: 1 }}>
|
|
100
|
+
<Pressable style={{ flex: 1 }} onPress={() => setMobileMenuOpen(false)}></Pressable>
|
|
101
|
+
</View>
|
|
105
102
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
103
|
+
<Animated.View
|
|
104
|
+
style={[
|
|
105
|
+
{
|
|
106
|
+
height: '65%',
|
|
107
|
+
borderTopColor: theme.appBorderColor,
|
|
108
|
+
borderTopWidth: 1,
|
|
109
|
+
borderStyle: 'solid',
|
|
110
|
+
backgroundColor: theme.background.content,
|
|
111
|
+
elevation: 8,
|
|
112
|
+
},
|
|
113
|
+
{ transform: [{ translateY: dragY }] },
|
|
114
|
+
]}
|
|
115
|
+
>
|
|
116
|
+
{/* Drag handle */}
|
|
117
|
+
<View
|
|
118
|
+
{...panResponder.panHandlers}
|
|
119
|
+
style={{
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
backgroundColor: theme.background.content,
|
|
123
|
+
}}
|
|
118
124
|
>
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
{...panResponder.panHandlers}
|
|
122
|
-
style={{
|
|
123
|
-
alignItems: 'center',
|
|
124
|
-
justifyContent: 'center',
|
|
125
|
-
backgroundColor: theme.background.content,
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
-
<View style={handleStyle} />
|
|
129
|
-
</View>
|
|
125
|
+
<View style={handleStyle} />
|
|
126
|
+
</View>
|
|
130
127
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
</SafeAreaView>
|
|
128
|
+
<ScrollView
|
|
129
|
+
ref={scrollRef}
|
|
130
|
+
keyboardShouldPersistTaps="handled"
|
|
131
|
+
style={{
|
|
132
|
+
flex: 1,
|
|
133
|
+
paddingBottom: 150,
|
|
134
|
+
alignSelf: 'flex-end',
|
|
135
|
+
width: '100%',
|
|
136
|
+
backgroundColor: theme.background.content,
|
|
137
|
+
}}
|
|
138
|
+
>
|
|
139
|
+
{children}
|
|
140
|
+
</ScrollView>
|
|
141
|
+
</Animated.View>
|
|
146
142
|
</KeyboardAvoidingView>
|
|
147
143
|
</Modal>
|
|
148
144
|
);
|
package/src/Search.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { styled } from '@storybook/react-native-theming';
|
|
|
2
2
|
import type { IFuseOptions } from 'fuse.js';
|
|
3
3
|
import Fuse from 'fuse.js';
|
|
4
4
|
import React, { useCallback, useDeferredValue, useRef, useState } from 'react';
|
|
5
|
-
import { TextInput, View } from 'react-native';
|
|
5
|
+
import { Platform, TextInput, View } from 'react-native';
|
|
6
6
|
import { useSelectedNode } from './SelectedNodeProvider';
|
|
7
7
|
import {
|
|
8
8
|
type CombinedDataset,
|
|
@@ -54,7 +54,8 @@ const SearchField = styled.View({
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
const Input = styled(TextInput)(({ theme }) => ({
|
|
57
|
-
height: 32,
|
|
57
|
+
height: Platform.OS === 'android' ? 'auto' : 32,
|
|
58
|
+
minHeight: 32,
|
|
58
59
|
paddingLeft: 28,
|
|
59
60
|
paddingRight: 28,
|
|
60
61
|
borderWidth: 1,
|
|
@@ -207,7 +208,12 @@ export const Search = React.memo<{
|
|
|
207
208
|
<SearchIcon />
|
|
208
209
|
</SearchIconWrapper>
|
|
209
210
|
|
|
210
|
-
<Input
|
|
211
|
+
<Input
|
|
212
|
+
ref={inputRef}
|
|
213
|
+
onChangeText={setInputValue}
|
|
214
|
+
onFocus={() => setIsOpen(true)}
|
|
215
|
+
returnKeyType="search"
|
|
216
|
+
/>
|
|
211
217
|
|
|
212
218
|
{isOpen && (
|
|
213
219
|
<ClearIcon
|
|
@@ -30,6 +30,8 @@ export const Default: Story = {
|
|
|
30
30
|
refId: 'storybook_internal',
|
|
31
31
|
path: ['NestingExample', 'Message', 'bubble'],
|
|
32
32
|
status: null,
|
|
33
|
+
subtype: 'story',
|
|
34
|
+
exportName: 'First',
|
|
33
35
|
},
|
|
34
36
|
refIndex: 46,
|
|
35
37
|
matches: [
|
|
@@ -86,6 +88,8 @@ export const Default: Story = {
|
|
|
86
88
|
refId: 'storybook_internal',
|
|
87
89
|
path: ['NestingExample', 'Message', 'bubble'],
|
|
88
90
|
status: null,
|
|
91
|
+
subtype: 'story',
|
|
92
|
+
exportName: 'First',
|
|
89
93
|
},
|
|
90
94
|
matches: [
|
|
91
95
|
{
|
package/src/Tree.stories.tsx
CHANGED
|
@@ -105,8 +105,10 @@ export const SingleStoryComponents: Story = {
|
|
|
105
105
|
args: {},
|
|
106
106
|
argTypes: {},
|
|
107
107
|
initialArgs: {},
|
|
108
|
+
exportName: 'Single',
|
|
108
109
|
depth: 1,
|
|
109
110
|
parent: 'single',
|
|
111
|
+
subtype: 'story',
|
|
110
112
|
renderLabel: () => <Text>🔥 Single</Text>,
|
|
111
113
|
importPath: './single.stories.js',
|
|
112
114
|
},
|