@niibase/bottom-sheet-manager 1.1.0
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/LICENSE +21 -0
- package/README.md +147 -0
- package/lib/commonjs/events.js +35 -0
- package/lib/commonjs/events.js.map +1 -0
- package/lib/commonjs/index.js +85 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/manager.js +171 -0
- package/lib/commonjs/manager.js.map +1 -0
- package/lib/commonjs/provider.js +229 -0
- package/lib/commonjs/provider.js.map +1 -0
- package/lib/commonjs/router/index.js +100 -0
- package/lib/commonjs/router/index.js.map +1 -0
- package/lib/commonjs/router/router.js +72 -0
- package/lib/commonjs/router/router.js.map +1 -0
- package/lib/commonjs/router/types.js +6 -0
- package/lib/commonjs/router/types.js.map +1 -0
- package/lib/commonjs/router/view.js +180 -0
- package/lib/commonjs/router/view.js.map +1 -0
- package/lib/commonjs/sheet.js +240 -0
- package/lib/commonjs/sheet.js.map +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/events.js +29 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/manager.js +165 -0
- package/lib/module/manager.js.map +1 -0
- package/lib/module/provider.js +210 -0
- package/lib/module/provider.js.map +1 -0
- package/lib/module/router/index.js +79 -0
- package/lib/module/router/index.js.map +1 -0
- package/lib/module/router/router.js +65 -0
- package/lib/module/router/router.js.map +1 -0
- package/lib/module/router/types.js +2 -0
- package/lib/module/router/types.js.map +1 -0
- package/lib/module/router/view.js +173 -0
- package/lib/module/router/view.js.map +1 -0
- package/lib/module/sheet.js +232 -0
- package/lib/module/sheet.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/events.d.ts +16 -0
- package/lib/typescript/events.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +6 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/manager.d.ts +78 -0
- package/lib/typescript/manager.d.ts.map +1 -0
- package/lib/typescript/provider.d.ts +69 -0
- package/lib/typescript/provider.d.ts.map +1 -0
- package/lib/typescript/router/index.d.ts +59 -0
- package/lib/typescript/router/index.d.ts.map +1 -0
- package/lib/typescript/router/router.d.ts +47 -0
- package/lib/typescript/router/router.d.ts.map +1 -0
- package/lib/typescript/router/types.d.ts +46 -0
- package/lib/typescript/router/types.d.ts.map +1 -0
- package/lib/typescript/router/view.d.ts +11 -0
- package/lib/typescript/router/view.d.ts.map +1 -0
- package/lib/typescript/sheet.d.ts +19 -0
- package/lib/typescript/sheet.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +125 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/package.json +102 -0
- package/src/events.ts +40 -0
- package/src/index.ts +11 -0
- package/src/manager.ts +223 -0
- package/src/provider.tsx +293 -0
- package/src/router/index.tsx +130 -0
- package/src/router/router.ts +94 -0
- package/src/router/types.ts +117 -0
- package/src/router/view.tsx +265 -0
- package/src/sheet.tsx +350 -0
- package/src/types.ts +153 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import RNBottomSheet, { BottomSheetBackdrop, BottomSheetFlatList, BottomSheetFooter, BottomSheetFooterContainer, BottomSheetHandle, BottomSheetScrollView, BottomSheetSectionList, BottomSheetTextInput, BottomSheetView, BottomSheetVirtualizedList } from "@gorhom/bottom-sheet";
|
|
3
|
+
import { BackHandler, Platform, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Easing, interpolate, useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
5
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
|
+
import { useTheme } from "@react-navigation/native";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { useProviderContext, useSheetAnimationContext, useSheetIDContext, useSheetRef } from "./provider";
|
|
9
|
+
import { PrivateManager } from "./manager";
|
|
10
|
+
import { eventManager } from "./events";
|
|
11
|
+
const useSheetManager = ({
|
|
12
|
+
id,
|
|
13
|
+
onHide,
|
|
14
|
+
onBeforeShow,
|
|
15
|
+
onContextUpdate
|
|
16
|
+
}) => {
|
|
17
|
+
const [visible, setVisible] = React.useState(false);
|
|
18
|
+
const currentContext = useProviderContext();
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
if (!id) return undefined;
|
|
21
|
+
const subscriptions = [eventManager.subscribe(`show_${id}`, (data, context) => {
|
|
22
|
+
if (currentContext !== context || visible) return;
|
|
23
|
+
onContextUpdate?.();
|
|
24
|
+
onBeforeShow?.(data);
|
|
25
|
+
setVisible(true);
|
|
26
|
+
}), eventManager.subscribe(`hide_${id}`, (data, context, dismiss) => {
|
|
27
|
+
if (currentContext !== context) return;
|
|
28
|
+
onHide?.(data, dismiss);
|
|
29
|
+
})];
|
|
30
|
+
return () => {
|
|
31
|
+
subscriptions.forEach(s => s?.unsubscribe?.());
|
|
32
|
+
};
|
|
33
|
+
}, [id, onHide, onBeforeShow, onContextUpdate, currentContext]);
|
|
34
|
+
return {
|
|
35
|
+
visible,
|
|
36
|
+
setVisible
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const BottomSheetComponent = /*#__PURE__*/React.forwardRef(({
|
|
40
|
+
children,
|
|
41
|
+
snapPoints,
|
|
42
|
+
onClose,
|
|
43
|
+
onBeforeShow,
|
|
44
|
+
stackBehavior = "switch",
|
|
45
|
+
hardwareBackPressToClose = true,
|
|
46
|
+
enableDynamicSizing = false,
|
|
47
|
+
handleIndicatorStyle,
|
|
48
|
+
iosModalSheetTypeOfAnimation: pageAnimation,
|
|
49
|
+
backgroundStyle,
|
|
50
|
+
handleStyle,
|
|
51
|
+
clickThrough,
|
|
52
|
+
fullScreen,
|
|
53
|
+
opacity,
|
|
54
|
+
...props
|
|
55
|
+
}, ref) => {
|
|
56
|
+
const currentSheetRef = useSheetRef();
|
|
57
|
+
const currentCtx = useProviderContext();
|
|
58
|
+
const {
|
|
59
|
+
isFullScreen,
|
|
60
|
+
iosModalSheetTypeOfAnimation
|
|
61
|
+
} = useSheetAnimationContext();
|
|
62
|
+
const animatedIndex = useSharedValue(0);
|
|
63
|
+
const {
|
|
64
|
+
colors
|
|
65
|
+
} = useTheme();
|
|
66
|
+
const {
|
|
67
|
+
top
|
|
68
|
+
} = useSafeAreaInsets();
|
|
69
|
+
const themeBackgroundStyle = React.useMemo(() => ({
|
|
70
|
+
backgroundColor: colors.card
|
|
71
|
+
}), [colors.card]);
|
|
72
|
+
const themeHandleIndicatorStyle = React.useMemo(() => ({
|
|
73
|
+
backgroundColor: colors.border,
|
|
74
|
+
height: 5,
|
|
75
|
+
width: 50
|
|
76
|
+
}), [colors.border]);
|
|
77
|
+
const valueRef = React.useRef(null);
|
|
78
|
+
const bottomSheetRef = React.useRef(null);
|
|
79
|
+
const hardwareBackPressEvent = React.useRef(null);
|
|
80
|
+
const id = useSheetIDContext();
|
|
81
|
+
const sheetId = props.id || id;
|
|
82
|
+
useSheetManager({
|
|
83
|
+
id: sheetId,
|
|
84
|
+
onHide: (data, dismiss) => hideSheet(data, true, dismiss),
|
|
85
|
+
onBeforeShow: data => {
|
|
86
|
+
onBeforeShow?.(data);
|
|
87
|
+
valueRef.current = undefined;
|
|
88
|
+
currentSheetRef.current = getInstance();
|
|
89
|
+
},
|
|
90
|
+
onContextUpdate: () => {
|
|
91
|
+
if (sheetId) {
|
|
92
|
+
PrivateManager.add(sheetId, currentCtx);
|
|
93
|
+
PrivateManager.registerRef(sheetId, currentCtx, {
|
|
94
|
+
current: getInstance()
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
useAnimatedReaction(() => {
|
|
100
|
+
if (!!iosModalSheetTypeOfAnimation || !!pageAnimation) {
|
|
101
|
+
isFullScreen.value = 0;
|
|
102
|
+
}
|
|
103
|
+
return animatedIndex.value;
|
|
104
|
+
}, index => {
|
|
105
|
+
"worklet";
|
|
106
|
+
|
|
107
|
+
const points = ["%100", "100%"];
|
|
108
|
+
const checkFullScreen = fullScreen ? -1 : snapPoints instanceof Array ? snapPoints.findIndex(p => points.includes(p)) : snapPoints?.value?.findIndex(p => points.includes(p)) || -1;
|
|
109
|
+
if (-1 !== checkFullScreen && (!!iosModalSheetTypeOfAnimation || !!pageAnimation)) {
|
|
110
|
+
isFullScreen.value = interpolate(index, [checkFullScreen - 1, checkFullScreen], [0, 1]);
|
|
111
|
+
}
|
|
112
|
+
}, [snapPoints]);
|
|
113
|
+
const hideSheet = React.useCallback((data, isSheetManagerOrRef, dismiss) => {
|
|
114
|
+
const value = data ?? valueRef.current;
|
|
115
|
+
if (!dismiss || stackBehavior !== "push") {
|
|
116
|
+
hardwareBackPressEvent.current?.remove();
|
|
117
|
+
bottomSheetRef.current?.close();
|
|
118
|
+
onClose?.(value);
|
|
119
|
+
}
|
|
120
|
+
if (sheetId) {
|
|
121
|
+
PrivateManager.remove(sheetId, currentCtx);
|
|
122
|
+
if (dismiss && stackBehavior === "push") return;
|
|
123
|
+
const history = PrivateManager.history.length >= 1;
|
|
124
|
+
eventManager.publish(`onclose_${sheetId}`, value, currentCtx, history || dismiss);
|
|
125
|
+
if (stackBehavior === "replace") return;
|
|
126
|
+
if (dismiss) {
|
|
127
|
+
PrivateManager.history.push({
|
|
128
|
+
id: sheetId,
|
|
129
|
+
context: currentCtx
|
|
130
|
+
});
|
|
131
|
+
} else if (history) {
|
|
132
|
+
const {
|
|
133
|
+
id,
|
|
134
|
+
context
|
|
135
|
+
} = PrivateManager.history.pop();
|
|
136
|
+
eventManager.publish(`show_wrap_${id}`, undefined, context, true);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (isSheetManagerOrRef) valueRef.current = data;
|
|
140
|
+
}, [sheetId, currentCtx, onClose]);
|
|
141
|
+
const getInstance = React.useCallback(() => ({
|
|
142
|
+
close(options = {}) {
|
|
143
|
+
valueRef.current = options.value;
|
|
144
|
+
bottomSheetRef.current?.close(options?.animationConfigs);
|
|
145
|
+
},
|
|
146
|
+
expand(animationConfigs) {
|
|
147
|
+
bottomSheetRef.current?.expand(animationConfigs);
|
|
148
|
+
},
|
|
149
|
+
collapse(animationConfigs) {
|
|
150
|
+
bottomSheetRef.current?.collapse(animationConfigs);
|
|
151
|
+
},
|
|
152
|
+
snapToIndex(index, animationConfigs) {
|
|
153
|
+
bottomSheetRef.current?.snapToIndex(index, animationConfigs);
|
|
154
|
+
},
|
|
155
|
+
snapToPosition(position, animationConfigs) {
|
|
156
|
+
bottomSheetRef.current?.snapToPosition(position, animationConfigs);
|
|
157
|
+
}
|
|
158
|
+
}), []);
|
|
159
|
+
React.useEffect(() => {
|
|
160
|
+
if (sheetId) {
|
|
161
|
+
PrivateManager.registerRef(sheetId, currentCtx, {
|
|
162
|
+
current: getInstance()
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
currentSheetRef.current = getInstance();
|
|
166
|
+
}, [currentCtx, getInstance, sheetId, currentSheetRef]);
|
|
167
|
+
React.useEffect(() => {
|
|
168
|
+
if (Platform.OS === "android" && hardwareBackPressToClose) {
|
|
169
|
+
hardwareBackPressEvent.current = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
170
|
+
bottomSheetRef.current?.close();
|
|
171
|
+
return true;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return () => hardwareBackPressEvent.current?.remove();
|
|
175
|
+
}, [hardwareBackPressToClose]);
|
|
176
|
+
React.useImperativeHandle(ref, getInstance, [getInstance]);
|
|
177
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
178
|
+
pointerEvents: "box-none",
|
|
179
|
+
style: [StyleSheet.absoluteFill, {
|
|
180
|
+
zIndex: sheetId && stackBehavior === "push" ? PrivateManager.zIndex(sheetId, currentCtx) : 0
|
|
181
|
+
}]
|
|
182
|
+
}, /*#__PURE__*/React.createElement(RNBottomSheet, _extends({
|
|
183
|
+
enableDynamicSizing: enableDynamicSizing,
|
|
184
|
+
animationConfigs: {
|
|
185
|
+
duration: 400,
|
|
186
|
+
easing: Easing.bezier(0.25, 0.1, 0.25, 1)
|
|
187
|
+
},
|
|
188
|
+
backdropComponent: props => /*#__PURE__*/React.createElement(BottomSheetBackdrop, _extends({
|
|
189
|
+
enableTouchThrough: !!clickThrough,
|
|
190
|
+
opacity: opacity || 0.45,
|
|
191
|
+
disappearsOnIndex: -1,
|
|
192
|
+
appearsOnIndex: 0
|
|
193
|
+
}, props))
|
|
194
|
+
}, props, {
|
|
195
|
+
ref: bottomSheetRef,
|
|
196
|
+
onClose: hideSheet,
|
|
197
|
+
animatedIndex: animatedIndex,
|
|
198
|
+
topInset: fullScreen ? 0 : top + (iosModalSheetTypeOfAnimation || pageAnimation ? 20 : 5),
|
|
199
|
+
snapPoints: enableDynamicSizing ? undefined : snapPoints ?? ["66%"],
|
|
200
|
+
handleIndicatorStyle: [themeHandleIndicatorStyle, handleIndicatorStyle],
|
|
201
|
+
backgroundStyle: [themeBackgroundStyle, backgroundStyle],
|
|
202
|
+
handleStyle: [themeBackgroundStyle, handleStyle]
|
|
203
|
+
}), children));
|
|
204
|
+
});
|
|
205
|
+
const BottomSheet = /*#__PURE__*/React.memo(BottomSheetComponent);
|
|
206
|
+
BottomSheet.displayName = "BottomSheet";
|
|
207
|
+
BottomSheet.View = BottomSheetView;
|
|
208
|
+
BottomSheet.ScrollView = BottomSheetScrollView;
|
|
209
|
+
BottomSheet.FlatList = BottomSheetFlatList;
|
|
210
|
+
BottomSheet.SectionList = BottomSheetSectionList;
|
|
211
|
+
BottomSheet.VirtualizedList = BottomSheetVirtualizedList;
|
|
212
|
+
BottomSheet.Handle = BottomSheetHandle;
|
|
213
|
+
BottomSheet.Footer = BottomSheetFooter;
|
|
214
|
+
BottomSheet.FooterContainer = BottomSheetFooterContainer;
|
|
215
|
+
BottomSheet.Backdrop = BottomSheetBackdrop;
|
|
216
|
+
BottomSheet.TextInput = BottomSheetTextInput;
|
|
217
|
+
try {
|
|
218
|
+
const {
|
|
219
|
+
cssInterop
|
|
220
|
+
} = require("nativewind");
|
|
221
|
+
cssInterop(BottomSheet, {
|
|
222
|
+
handleIndicatorClassName: "handleIndicatorStyle",
|
|
223
|
+
backgroundClassName: "backgroundStyle",
|
|
224
|
+
containerClassName: "containerStyle",
|
|
225
|
+
handleClassName: "handleStyle",
|
|
226
|
+
className: "style"
|
|
227
|
+
});
|
|
228
|
+
} catch (e) {
|
|
229
|
+
// Ignore error
|
|
230
|
+
}
|
|
231
|
+
export default BottomSheet;
|
|
232
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RNBottomSheet","BottomSheetBackdrop","BottomSheetFlatList","BottomSheetFooter","BottomSheetFooterContainer","BottomSheetHandle","BottomSheetScrollView","BottomSheetSectionList","BottomSheetTextInput","BottomSheetView","BottomSheetVirtualizedList","BackHandler","Platform","StyleSheet","View","Easing","interpolate","useAnimatedReaction","useSharedValue","useSafeAreaInsets","useTheme","React","useProviderContext","useSheetAnimationContext","useSheetIDContext","useSheetRef","PrivateManager","eventManager","useSheetManager","id","onHide","onBeforeShow","onContextUpdate","visible","setVisible","useState","currentContext","useEffect","undefined","subscriptions","subscribe","data","context","dismiss","forEach","s","unsubscribe","BottomSheetComponent","forwardRef","children","snapPoints","onClose","stackBehavior","hardwareBackPressToClose","enableDynamicSizing","handleIndicatorStyle","iosModalSheetTypeOfAnimation","pageAnimation","backgroundStyle","handleStyle","clickThrough","fullScreen","opacity","props","ref","currentSheetRef","currentCtx","isFullScreen","animatedIndex","colors","top","themeBackgroundStyle","useMemo","backgroundColor","card","themeHandleIndicatorStyle","border","height","width","valueRef","useRef","bottomSheetRef","hardwareBackPressEvent","sheetId","hideSheet","current","getInstance","add","registerRef","value","index","points","checkFullScreen","Array","findIndex","p","includes","useCallback","isSheetManagerOrRef","remove","close","history","length","publish","push","pop","options","animationConfigs","expand","collapse","snapToIndex","snapToPosition","position","OS","addEventListener","useImperativeHandle","createElement","pointerEvents","style","absoluteFill","zIndex","_extends","duration","easing","bezier","backdropComponent","enableTouchThrough","disappearsOnIndex","appearsOnIndex","topInset","BottomSheet","memo","displayName","ScrollView","FlatList","SectionList","VirtualizedList","Handle","Footer","FooterContainer","Backdrop","TextInput","cssInterop","require","handleIndicatorClassName","backgroundClassName","containerClassName","handleClassName","className","e"],"sourceRoot":"../../src","sources":["sheet.tsx"],"mappings":";AAAA,OAAOA,aAAa,IAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,iBAAiB,EACjBC,0BAA0B,EAC1BC,iBAAiB,EAEjBC,qBAAqB,EACrBC,sBAAsB,EACtBC,oBAAoB,EACpBC,eAAe,EACfC,0BAA0B,QACrB,sBAAsB;AAC7B,SACEC,WAAW,EACXC,QAAQ,EACRC,UAAU,EACVC,IAAI,QAEC,cAAc;AACrB,SACEC,MAAM,EACNC,WAAW,EACXC,mBAAmB,EACnBC,cAAc,QACT,yBAAyB;AAChC,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SACEC,kBAAkB,EAClBC,wBAAwB,EACxBC,iBAAiB,EACjBC,WAAW,QACN,YAAY;AAEnB,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,YAAY,QAAQ,UAAU;AAqBvC,MAAMC,eAAe,GAAGA,CAAC;EACvBC,EAAE;EACFC,MAAM;EACNC,YAAY;EACZC;AAMF,CAAC,KAAK;EACJ,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGb,KAAK,CAACc,QAAQ,CAAC,KAAK,CAAC;EACnD,MAAMC,cAAc,GAAGd,kBAAkB,CAAC,CAAC;EAE3CD,KAAK,CAACgB,S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[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NativeEventEmitter } from "react-native";
|
|
2
|
+
export type EventHandler = (...args: any[]) => void;
|
|
3
|
+
export type EventHandlerSubscription = {
|
|
4
|
+
unsubscribe: () => void;
|
|
5
|
+
};
|
|
6
|
+
export default class EventManager {
|
|
7
|
+
_registry?: NativeEventEmitter;
|
|
8
|
+
constructor();
|
|
9
|
+
subscribe(name: string, handler: EventHandler): {
|
|
10
|
+
unsubscribe: () => void | undefined;
|
|
11
|
+
};
|
|
12
|
+
publish(name: string, ...args: any[]): void;
|
|
13
|
+
remove(...names: string[]): void;
|
|
14
|
+
}
|
|
15
|
+
export declare const eventManager: EventManager;
|
|
16
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,kBAAkB,EAErB,MAAM,cAAc,CAAC;AAGtB,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AACpD,MAAM,MAAM,wBAAwB,GAAG;IACnC,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,YAAY;IAC7B,SAAS,CAAC,EAAE,kBAAkB,CAAC;;IAQ/B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;;;IAM7C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAIpC,MAAM,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE;CAK5B;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as BottomSheet } from "./sheet";
|
|
2
|
+
export { SheetManager } from "./manager";
|
|
3
|
+
export * from "./router";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
export { SheetProvider, useSheetPayload, useSheetRef, useOnSheet, registerSheet, } from "./provider";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EACH,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,aAAa,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import { BottomSheetInstance, Sheets } from "./types";
|
|
3
|
+
export declare const PrivateManager: {
|
|
4
|
+
history: {
|
|
5
|
+
id: string;
|
|
6
|
+
context: string;
|
|
7
|
+
}[];
|
|
8
|
+
context(options?: {
|
|
9
|
+
context?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
}): string | undefined;
|
|
12
|
+
registerRef: (id: string, context: string, instance: RefObject<BottomSheetInstance>) => void;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* Get internal ref of a sheet by the given id.
|
|
16
|
+
*
|
|
17
|
+
* @param id Id of the sheet
|
|
18
|
+
* @param context Context in which the sheet is rendered. Normally this function returns the top most rendered sheet ref automatically.
|
|
19
|
+
*/
|
|
20
|
+
get: <SheetId extends keyof Sheets>(id: SheetId | (string & {}), context?: string) => RefObject<BottomSheetInstance<SheetId>>;
|
|
21
|
+
add: (id: string, context: string) => void;
|
|
22
|
+
remove: (id: string, context: string) => void;
|
|
23
|
+
zIndex: (id: string, context?: string) => number;
|
|
24
|
+
stack: () => {
|
|
25
|
+
id: string;
|
|
26
|
+
context: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
declare class _SheetManager {
|
|
30
|
+
/**
|
|
31
|
+
* Show the Modal Sheet with an id.
|
|
32
|
+
*
|
|
33
|
+
* @param id id of the Sheet to show
|
|
34
|
+
* @param options
|
|
35
|
+
*/
|
|
36
|
+
show<SheetId extends keyof Sheets>(id: SheetId | (string & {}), options?: {
|
|
37
|
+
/**
|
|
38
|
+
* Any data to pass to the Sheet. Will be available from the component `props` prop on the modal sheet.
|
|
39
|
+
*/
|
|
40
|
+
payload?: Sheets[SheetId]["payload"];
|
|
41
|
+
/**
|
|
42
|
+
* Receive payload from the Sheet when it closes
|
|
43
|
+
*/
|
|
44
|
+
onClose?: (data: Sheets[SheetId]["returnValue"] | undefined) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Provide `context` of the `SheetProvider` where you want to show the action sheet.
|
|
47
|
+
*/
|
|
48
|
+
context?: string;
|
|
49
|
+
}): Promise<Sheets[SheetId]["returnValue"]>;
|
|
50
|
+
/**
|
|
51
|
+
* An async hide function. This is useful when you want to show one Sheet after closing another.
|
|
52
|
+
*
|
|
53
|
+
* @param id id of the Sheet to show
|
|
54
|
+
* @param data
|
|
55
|
+
*/
|
|
56
|
+
hide<SheetId extends keyof Sheets>(id: SheetId | (string & {}), options?: {
|
|
57
|
+
/**
|
|
58
|
+
* Return some data to the caller on closing the Sheet.
|
|
59
|
+
*/
|
|
60
|
+
payload?: Sheets[SheetId]["returnValue"];
|
|
61
|
+
/**
|
|
62
|
+
* Provide `context` of the `SheetProvider` to hide the action sheet.
|
|
63
|
+
*/
|
|
64
|
+
context?: string;
|
|
65
|
+
}): Promise<Sheets[SheetId]["returnValue"]>;
|
|
66
|
+
/**
|
|
67
|
+
* Hide all the opened Sheets.
|
|
68
|
+
*
|
|
69
|
+
* @param id Hide all sheets for the specific id.
|
|
70
|
+
*/
|
|
71
|
+
hideAll<SheetId extends keyof Sheets>(id?: SheetId | (string & {})): void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* SheetManager is used to imperatively show/hide any sheet with a unique id prop.
|
|
75
|
+
*/
|
|
76
|
+
export declare const SheetManager: _SheetManager;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAUtD,eAAO,MAAM,cAAc;aAER;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;sBAE9B;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE;sBAoB3C,MAAM,WACD,MAAM,YACL,SAAS,CAAC,mBAAmB,CAAC;IAO5C;;;;;;OAMG;UACG,OAAO,SAAS,MAAM,MAAM,MAC1B,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,YACjB,MAAM,KACjB,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;cAchC,MAAM,WAAW,MAAM;iBAMpB,MAAM,WAAW,MAAM;iBAMvB,MAAM,YAAW,MAAM,KAAc,MAAM;;;;;CAY3D,CAAC;AAEF,cAAM,aAAa;IACf;;;;;OAKG;IACG,IAAI,CAAC,OAAO,SAAS,MAAM,MAAM,EACnC,EAAE,EAAE,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAC3B,OAAO,CAAC,EAAE;QACN;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;QAErC;;WAEG;QACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;QAErE;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB,GACF,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;IAiC1C;;;;;OAKG;IACG,IAAI,CAAC,OAAO,SAAS,MAAM,MAAM,EACnC,EAAE,EAAE,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAC3B,OAAO,CAAC,EAAE;QACN;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;QACzC;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB,GACF,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;IAiC1C;;;;OAIG;IACH,OAAO,CAAC,OAAO,SAAS,MAAM,MAAM,EAAE,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;CAMrE;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,eAAsB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SharedValue } from "react-native-reanimated";
|
|
3
|
+
import { BottomSheetInstance, SheetPayload, Sheets } from "./types";
|
|
4
|
+
export declare const providerRegistryStack: string[];
|
|
5
|
+
/**
|
|
6
|
+
* An object that holds all the sheet components against their ids.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sheetsRegistry: {
|
|
9
|
+
[context: string]: {
|
|
10
|
+
[id: string]: React.ElementType;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export interface SheetProps<SheetId extends keyof Sheets = never> {
|
|
14
|
+
sheetId: SheetId;
|
|
15
|
+
payload?: Sheets[SheetId]["payload"];
|
|
16
|
+
}
|
|
17
|
+
export declare function registerSheet<SheetId extends keyof Sheets = never>(id: SheetId | (string & {}), Sheet: React.ElementType, ...contexts: string[]): void;
|
|
18
|
+
/**
|
|
19
|
+
* The SheetProvider makes available the sheets in a given context. The default context is
|
|
20
|
+
* `global`. However if you want to render a Sheet within another sheet or if you want to render
|
|
21
|
+
* Sheets in a modal. You can use a separate Provider with a custom context value.
|
|
22
|
+
*
|
|
23
|
+
* For example
|
|
24
|
+
* ```ts
|
|
25
|
+
* // Define your SheetProvider in the component/modal where
|
|
26
|
+
* // you want to show some Sheets.
|
|
27
|
+
* <SheetProvider context="local-context" />
|
|
28
|
+
*
|
|
29
|
+
* // Then register your sheet when for example the
|
|
30
|
+
* // Modal component renders.
|
|
31
|
+
*
|
|
32
|
+
* registerSheet('local-sheet', LocalSheet,'local-context');
|
|
33
|
+
*
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function SheetProvider({ iosModalSheetTypeOfAnimation, context, duration, children, }: React.PropsWithChildren<{
|
|
37
|
+
context?: string;
|
|
38
|
+
duration?: number;
|
|
39
|
+
iosModalSheetTypeOfAnimation?: boolean;
|
|
40
|
+
}>): React.JSX.Element;
|
|
41
|
+
export declare const SheetRefContext: React.Context<React.RefObject<BottomSheetInstance<never> | null>>;
|
|
42
|
+
/**
|
|
43
|
+
* Get id of the current context.
|
|
44
|
+
*/
|
|
45
|
+
export declare const useProviderContext: () => string;
|
|
46
|
+
/**
|
|
47
|
+
* Get id of the current sheet
|
|
48
|
+
*/
|
|
49
|
+
export declare const useSheetIDContext: () => string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Get the current sheet animation context.
|
|
52
|
+
*/
|
|
53
|
+
export declare const useSheetAnimationContext: () => {
|
|
54
|
+
iosModalSheetTypeOfAnimation: boolean;
|
|
55
|
+
isFullScreen: SharedValue<number>;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Get the current Sheet's internal ref.
|
|
59
|
+
*/
|
|
60
|
+
export declare const useSheetRef: <SheetId extends keyof Sheets = never>() => React.MutableRefObject<BottomSheetInstance<SheetId>>;
|
|
61
|
+
/**
|
|
62
|
+
* Get the payload this sheet was opened with.
|
|
63
|
+
*/
|
|
64
|
+
export declare function useSheetPayload<SheetId extends keyof Sheets = never>(): Sheets[SheetId]["payload"];
|
|
65
|
+
/**
|
|
66
|
+
* Listen to sheet events.
|
|
67
|
+
*/
|
|
68
|
+
export declare function useOnSheet<SheetId extends keyof Sheets = never>(id: SheetId | (string & {}), type: "show" | "hide" | "onclose", listener: (payload: SheetPayload<SheetId>, context: string, ...args: any[]) => void): void;
|
|
69
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAiB,EAIf,WAAW,EAMZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGpE,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAAO,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE;IAC3B,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,WAAW,CAAA;KAAE,CAAC;CAGxD,CAAC;AAEF,MAAM,WAAW,UAAU,CAAC,OAAO,SAAS,MAAM,MAAM,GAAG,KAAK;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;CACtC;AAGD,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,MAAM,GAAG,KAAK,EAChE,EAAE,EAAE,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAC3B,KAAK,EAAE,KAAK,CAAC,WAAW,EACxB,GAAG,QAAQ,EAAE,MAAM,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navigation/native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { BottomSheetNavigationEventMap, BottomSheetNavigationOptions, BottomSheetNavigationProp, BottomSheetNavigationState, BottomSheetNavigatorProps } from "./types";
|
|
4
|
+
declare function BottomSheetNavigator({ id, children, screenListeners, screenOptions, ...rest }: BottomSheetNavigatorProps): React.JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* To use BottomSheetNavigator with expo-router, the first screen should be your app content
|
|
7
|
+
* and add a border radius of 24px to the root view if want to snap to 100%.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import {
|
|
12
|
+
* createBottomSheetNavigator,
|
|
13
|
+
* BottomSheetNavigationOptions,
|
|
14
|
+
* BottomSheetNavigationEventMap,
|
|
15
|
+
* BottomSheetNavigationState,
|
|
16
|
+
* } from "@repo/bottom-sheet";
|
|
17
|
+
* import { Slot, withLayoutContext } from "expo-router";
|
|
18
|
+
*
|
|
19
|
+
* const { Navigator } = createBottomSheetNavigator();
|
|
20
|
+
*
|
|
21
|
+
* const BottomSheet = withLayoutContext<
|
|
22
|
+
* BottomSheetNavigationOptions,
|
|
23
|
+
* typeof Navigator,
|
|
24
|
+
* BottomSheetNavigationState<any>,
|
|
25
|
+
* BottomSheetNavigationEventMap
|
|
26
|
+
* >(Navigator);
|
|
27
|
+
*
|
|
28
|
+
* export const unstable_settings = {
|
|
29
|
+
* initialRouteName: "index",
|
|
30
|
+
* };
|
|
31
|
+
*
|
|
32
|
+
* export default function Layout() {
|
|
33
|
+
* if (typeof window === "undefined") return <Slot />;
|
|
34
|
+
* return (
|
|
35
|
+
* <BottomSheet
|
|
36
|
+
* screenOptions={
|
|
37
|
+
* {
|
|
38
|
+
* // API Reference: `@repo/design/bottom-sheet/types.ts`
|
|
39
|
+
* // And: https://gorhom.github.io/react-native-bottom-sheet/modal/props/
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
*. />
|
|
43
|
+
* );
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function createBottomSheetNavigator<const ParamList extends ParamListBase, const NavigatorID extends string | undefined = undefined, const TypeBag extends NavigatorTypeBagBase = {
|
|
48
|
+
ParamList: ParamList;
|
|
49
|
+
NavigatorID: NavigatorID;
|
|
50
|
+
State: BottomSheetNavigationState<ParamList>;
|
|
51
|
+
ScreenOptions: BottomSheetNavigationOptions;
|
|
52
|
+
EventMap: BottomSheetNavigationEventMap;
|
|
53
|
+
NavigationList: {
|
|
54
|
+
[RouteName in keyof ParamList]: BottomSheetNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
55
|
+
};
|
|
56
|
+
Navigator: typeof BottomSheetNavigator;
|
|
57
|
+
}, const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>>(config?: Config): TypedNavigator<TypeBag, Config>;
|
|
58
|
+
export * from "./types";
|
|
59
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/router/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,cAAc,EAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAEV,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAGjB,iBAAS,oBAAoB,CAAC,EAC5B,EAAE,EACF,QAAQ,EACR,eAAe,EACf,aAAa,EACb,GAAG,IAAI,EACR,EAAE,yBAAyB,qBAwB3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,SAAS,SAAS,aAAa,EACrC,KAAK,CAAC,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAExD,KAAK,CAAC,OAAO,SAAS,oBAAoB,GAAG;IAE3C,SAAS,EAAE,SAAS,CAAC;IAErB,WAAW,EAAE,WAAW,CAAC;IAEzB,KAAK,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAE7C,aAAa,EAAE,4BAA4B,CAAC;IAE5C,QAAQ,EAAE,6BAA6B,CAAC;IAExC,cAAc,EAAE;SACb,SAAS,IAAI,MAAM,SAAS,GAAG,yBAAyB,CACvD,SAAS,EACT,SAAS,EACT,WAAW,CACZ;KACF,CAAC;IAEF,SAAS,EAAE,OAAO,oBAAoB,CAAC;CACxC,EAED,KAAK,CAAC,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,EAClE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAIlD;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ParamListBase, Router, StackActionType, StackRouterOptions } from "@react-navigation/native";
|
|
2
|
+
import type { BottomSheetNavigationState } from "./types";
|
|
3
|
+
export type BottomSheetRouterOptions = StackRouterOptions;
|
|
4
|
+
export type BottomSheetActionType = StackActionType | {
|
|
5
|
+
type: "SNAP_TO";
|
|
6
|
+
index: number;
|
|
7
|
+
source?: string;
|
|
8
|
+
target?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const BottomSheetActions: {
|
|
11
|
+
snapTo(index: number): BottomSheetActionType;
|
|
12
|
+
replace(name: string, params?: object): {
|
|
13
|
+
readonly type: "REPLACE";
|
|
14
|
+
readonly payload: {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly params: object | undefined;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
push(name: string, params?: object): {
|
|
20
|
+
readonly type: "PUSH";
|
|
21
|
+
readonly payload: {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly params: object | undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
pop(count?: number): {
|
|
27
|
+
readonly type: "POP";
|
|
28
|
+
readonly payload: {
|
|
29
|
+
readonly count: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
popToTop(): {
|
|
33
|
+
readonly type: "POP_TO_TOP";
|
|
34
|
+
};
|
|
35
|
+
popTo(name: string, params?: object, options?: {
|
|
36
|
+
merge?: boolean;
|
|
37
|
+
}): {
|
|
38
|
+
readonly type: "POP_TO";
|
|
39
|
+
readonly payload: {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly params: object | undefined;
|
|
42
|
+
readonly merge: boolean | undefined;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare function BottomSheetRouter(routerOptions: StackRouterOptions): Router<BottomSheetNavigationState<ParamListBase>, BottomSheetActionType>;
|
|
47
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/router/router.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,MAAM,EAEN,eAAe,EAEf,kBAAkB,EACrB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAC3B,eAAe,GACf;IACI,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAER,eAAO,MAAM,kBAAkB;kBAEb,MAAM,GAAG,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;aAqEu2B,CAAC;;;;;;;;;CAlEv5B,CAAC;AAEF,wBAAgB,iBAAiB,CAC7B,aAAa,EAAE,kBAAkB,GAClC,MAAM,CAAC,0BAA0B,CAAC,aAAa,CAAC,EAAE,qBAAqB,CAAC,CA6D1E"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { BottomSheetModalProps } from "@gorhom/bottom-sheet";
|
|
2
|
+
import type { DefaultNavigatorOptions, Descriptor, NavigationHelpers, NavigationProp, NavigationState, ParamListBase, RouteProp, StackActionHelpers } from "@react-navigation/native";
|
|
3
|
+
export type BottomSheetNavigationEventMap = {};
|
|
4
|
+
export type BottomSheetNavigationState<ParamList extends ParamListBase> = Omit<NavigationState<ParamList>, "routes"> & {
|
|
5
|
+
type: "bottom-sheet";
|
|
6
|
+
routes: (NavigationState<ParamList>["routes"][number] & {
|
|
7
|
+
snapToIndex?: number | null;
|
|
8
|
+
})[];
|
|
9
|
+
};
|
|
10
|
+
export type BottomSheetActionHelpers<ParamList extends ParamListBase> = StackActionHelpers<ParamList> & {
|
|
11
|
+
/**
|
|
12
|
+
* Snap the drawer to a point.
|
|
13
|
+
*/
|
|
14
|
+
snapTo(index?: number): void;
|
|
15
|
+
};
|
|
16
|
+
export type BottomSheetNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = string, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, BottomSheetNavigationState<ParamList>, BottomSheetNavigationOptions, BottomSheetNavigationEventMap> & BottomSheetActionHelpers<ParamList>;
|
|
17
|
+
export type BottomSheetScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = string, NavigatorID extends string | undefined = undefined> = {
|
|
18
|
+
navigation: BottomSheetNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
19
|
+
route: RouteProp<ParamList, RouteName>;
|
|
20
|
+
};
|
|
21
|
+
export type BottomSheetNavigationHelpers = NavigationHelpers<ParamListBase, BottomSheetNavigationEventMap>;
|
|
22
|
+
export type BottomSheetNavigationConfig = {};
|
|
23
|
+
export type BottomSheetNavigationOptions = Omit<BottomSheetModalProps, "containerHeight" | "snapPoints" | "gestureEventsHandlersHook" | "animatedPosition" | "animatedIndex" | "topInset" | "onChange" | "onAnimate" | "onClose" | "children" | "$modal" | "waitFor" | "simultaneousHandlers"> & {
|
|
24
|
+
/**
|
|
25
|
+
* Points for the bottom sheet to snap to. It accepts array of number, string or mix.
|
|
26
|
+
* String values should be a percentage.
|
|
27
|
+
* @example
|
|
28
|
+
* snapPoints={[200, 500]}
|
|
29
|
+
* snapPoints={[200, '%50']}
|
|
30
|
+
* snapPoints={['%100']}
|
|
31
|
+
* @type Array<string | number>
|
|
32
|
+
*/
|
|
33
|
+
snapPoints?: Array<string | number>;
|
|
34
|
+
/**
|
|
35
|
+
* When `true`, tapping on the backdrop will not dismiss the modal.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
clickThrough?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type BottomSheetNavigatorProps = DefaultNavigatorOptions<ParamListBase, undefined, // or your ID if you want a named ID, e.g. 'BottomSheetNavigator'
|
|
41
|
+
BottomSheetNavigationState<ParamListBase>, BottomSheetNavigationOptions, BottomSheetNavigationEventMap, BottomSheetNavigationHelpers> & BottomSheetNavigationConfig;
|
|
42
|
+
export type BottomSheetDescriptor = Descriptor<BottomSheetNavigationOptions, BottomSheetNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
|
|
43
|
+
export type BottomSheetDescriptorMap = {
|
|
44
|
+
[key: string]: BottomSheetDescriptor;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/router/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EACR,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,kBAAkB,EACrB,MAAM,0BAA0B,CA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M,2BAA2B,GAAG,EAAE,CAAC;AAE7C,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC3C,qBAAqB,EAEnB,iBAAiB,GACjB,YAAY,GACZ,2BAA2B,GAC3B,kBAAkB,GAClB,eAAe,GACf,UAAU,GACV,UAAU,GACV,WAAW,GACX,SAAS,GACT,UAAU,GACV,QAAQ,GACR,SAAS,GACT,sBAAsB,CAC3B,GAAG;IACA;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,uBAAuB,CAC3D,aAAa,EACb,SAAS,EAAE,iEAAiE;AAC5E,0BAA0B,CAAC,aAAa,CAAC,EACzC,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,CAC/B,GACG,2BAA2B,CAAC;AAEhC,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAC1C,4BAA4B,EAC5B,yBAAyB,CAAC,aAAa,CAAC,EACxC,SAAS,CAAC,aAAa,CAAC,CAC3B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAC;CACxC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ParamListBase } from "@react-navigation/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import type { BottomSheetDescriptorMap, BottomSheetNavigationConfig, BottomSheetNavigationHelpers, BottomSheetNavigationState } from "./types";
|
|
4
|
+
type Props = BottomSheetNavigationConfig & {
|
|
5
|
+
state: BottomSheetNavigationState<ParamListBase>;
|
|
6
|
+
navigation: BottomSheetNavigationHelpers;
|
|
7
|
+
descriptors: BottomSheetDescriptorMap;
|
|
8
|
+
};
|
|
9
|
+
export declare function BottomSheetView({ state, descriptors }: Props): React.JSX.Element | null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/router/view.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAY,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAE5B,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAgGjB,KAAK,KAAK,GAAG,2BAA2B,GAAG;IACzC,KAAK,EAAE,0BAA0B,CAAC,aAAa,CAAC,CAAC;IACjD,UAAU,EAAE,4BAA4B,CAAC;IACzC,WAAW,EAAE,wBAAwB,CAAC;CACvC,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,KAAK,4BAuI5D"}
|