@niibase/bottom-sheet-manager 1.2.0 → 1.4.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/README.md +414 -69
- package/lib/commonjs/events.js +100 -15
- package/lib/commonjs/events.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager.js +153 -35
- package/lib/commonjs/manager.js.map +1 -1
- package/lib/commonjs/provider.js +92 -54
- package/lib/commonjs/provider.js.map +1 -1
- package/lib/commonjs/router/index.js +80 -21
- package/lib/commonjs/router/index.js.map +1 -1
- package/lib/commonjs/router/router.js +137 -12
- package/lib/commonjs/router/router.js.map +1 -1
- package/lib/commonjs/router/view.js +93 -126
- package/lib/commonjs/router/view.js.map +1 -1
- package/lib/commonjs/sheet.js +122 -98
- package/lib/commonjs/sheet.js.map +1 -1
- package/lib/module/events.js +100 -15
- package/lib/module/events.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager.js +154 -35
- package/lib/module/manager.js.map +1 -1
- package/lib/module/provider.js +87 -50
- package/lib/module/provider.js.map +1 -1
- package/lib/module/router/index.js +66 -19
- package/lib/module/router/index.js.map +1 -1
- package/lib/module/router/router.js +135 -11
- package/lib/module/router/router.js.map +1 -1
- package/lib/module/router/view.js +92 -126
- package/lib/module/router/view.js.map +1 -1
- package/lib/module/sheet.js +124 -100
- package/lib/module/sheet.js.map +1 -1
- package/lib/typescript/events.d.ts +46 -12
- package/lib/typescript/events.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/manager.d.ts +73 -7
- package/lib/typescript/manager.d.ts.map +1 -1
- package/lib/typescript/provider.d.ts +22 -16
- package/lib/typescript/provider.d.ts.map +1 -1
- package/lib/typescript/router/index.d.ts +47 -17
- package/lib/typescript/router/index.d.ts.map +1 -1
- package/lib/typescript/router/router.d.ts +44 -5
- package/lib/typescript/router/router.d.ts.map +1 -1
- package/lib/typescript/router/types.d.ts +142 -32
- package/lib/typescript/router/types.d.ts.map +1 -1
- package/lib/typescript/router/view.d.ts +3 -3
- package/lib/typescript/router/view.d.ts.map +1 -1
- package/lib/typescript/sheet.d.ts +1 -1
- package/lib/typescript/sheet.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +52 -21
- package/lib/typescript/types.d.ts.map +1 -1
- package/package.json +14 -15
- package/src/events.ts +118 -27
- package/src/index.ts +2 -1
- package/src/manager.ts +209 -42
- package/src/provider.tsx +144 -71
- package/src/router/index.tsx +77 -33
- package/src/router/router.ts +188 -15
- package/src/router/types.ts +172 -57
- package/src/router/view.tsx +111 -213
- package/src/sheet.tsx +192 -124
- package/src/types.ts +51 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAYrE,UAAU,YAAY;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,aAAa,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc;aAER,YAAY,EAAE;sBAEX;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE;sBA8B3C,MAAM,WACD,MAAM,YACL,SAAS,CAAC,mBAAmB,CAAC;IAS5C;;;;;OAKG;UACG,OAAO,SAAS,MAAM,MAAM,MAC1B,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CA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AO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAC3B,OAAO,CAAC,EAAE,MAAM,GACjB,OAAO;IAIV;;OAEG;IACH,KAAK,IAAI,IAAI;CAGhB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,eAAsB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { SharedValue } from "react-native-reanimated";
|
|
3
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BottomSheetInstance, SheetPayload, SheetProviderProps, Sheets, StackBehavior } from "./types";
|
|
4
4
|
export declare const providerRegistryStack: string[];
|
|
5
5
|
/**
|
|
6
6
|
* An object that holds all the sheet components against their ids.
|
|
@@ -20,25 +20,25 @@ export declare function registerSheet<SheetId extends keyof Sheets = never>(id:
|
|
|
20
20
|
* `global`. However if you want to render a Sheet within another sheet or if you want to render
|
|
21
21
|
* Sheets in a modal. You can use a separate Provider with a custom context value.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
23
|
+
* > **Note:** Context names must be unique across all `SheetProvider` instances.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
24
26
|
* ```ts
|
|
25
27
|
* // Define your SheetProvider in the component/modal where
|
|
26
28
|
* // you want to show some Sheets.
|
|
27
29
|
* <SheetProvider context="local-context" />
|
|
28
30
|
*
|
|
29
|
-
* // Then register your sheet
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* registerSheet('local-sheet', LocalSheet,'local-context');
|
|
33
|
-
*
|
|
31
|
+
* // Then register your sheet at module level (outside JSX):
|
|
32
|
+
* registerSheet('local-sheet', LocalSheet, 'local-context');
|
|
34
33
|
* ```
|
|
35
34
|
*/
|
|
36
|
-
export declare function SheetProvider({
|
|
37
|
-
context?: string;
|
|
38
|
-
duration?: number;
|
|
39
|
-
iosModalSheetTypeOfAnimation?: boolean;
|
|
40
|
-
}>): React.JSX.Element;
|
|
35
|
+
export declare function SheetProvider({ context, statusBar, scaleConfig, children, }: SheetProviderProps): React.JSX.Element;
|
|
41
36
|
export declare const SheetRefContext: React.Context<React.RefObject<BottomSheetInstance<never> | null>>;
|
|
37
|
+
interface StackBehaviorContextValue {
|
|
38
|
+
behavior: StackBehavior;
|
|
39
|
+
isTransitioning: boolean;
|
|
40
|
+
previousSheetId: string | null;
|
|
41
|
+
}
|
|
42
42
|
/**
|
|
43
43
|
* Get id of the current context.
|
|
44
44
|
*/
|
|
@@ -50,12 +50,17 @@ export declare const useSheetIDContext: () => string | undefined;
|
|
|
50
50
|
/**
|
|
51
51
|
* Get the current sheet animation context.
|
|
52
52
|
*/
|
|
53
|
-
export declare const
|
|
54
|
-
iosModalSheetTypeOfAnimation: boolean;
|
|
53
|
+
export declare const useSheetSharedContext: () => {
|
|
55
54
|
isFullScreen: SharedValue<number>;
|
|
55
|
+
topInset: number;
|
|
56
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Get stack behavior context for the current sheet.
|
|
59
|
+
*/
|
|
60
|
+
export declare const useStackBehaviorContext: () => StackBehaviorContextValue;
|
|
57
61
|
/**
|
|
58
62
|
* Get the current Sheet's internal ref.
|
|
63
|
+
* Note: `current` may be null before the sheet is fully mounted.
|
|
59
64
|
*/
|
|
60
65
|
export declare const useSheetRef: <SheetId extends keyof Sheets = never>() => React.MutableRefObject<BottomSheetInstance<SheetId>>;
|
|
61
66
|
/**
|
|
@@ -65,5 +70,6 @@ export declare function useSheetPayload<SheetId extends keyof Sheets = never>():
|
|
|
65
70
|
/**
|
|
66
71
|
* Listen to sheet events.
|
|
67
72
|
*/
|
|
68
|
-
export declare function useOnSheet<SheetId extends keyof Sheets = never>(id: SheetId | (string & {}), type: "show" | "hide" | "onclose", listener: (payload: SheetPayload<SheetId>, context: string, ...args:
|
|
73
|
+
export declare function useOnSheet<SheetId extends keyof Sheets = never>(id: SheetId | (string & {}), type: "show" | "hide" | "onclose", listener: (payload: SheetPayload<SheetId>, context: string, ...args: unknown[]) => void): void;
|
|
74
|
+
export {};
|
|
69
75
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAiB,EAIf,WAAW,EAMZ,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,MAAM,EACN,aAAa,EACd,MAAM,SAAS,CAAC;AAGjB,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,EAAE,QAWtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAkB,EAClB,SAAS,EACT,WAAW,EACX,QAAQ,GACT,EAAE,kBAAkB,qBAqGpB;AAYD,eAAO,MAAM,eAAe,mEAEwB,CAAC;AAKrD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,aAAa,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAQD;;GAEG;AACH,eAAO,MAAM,kBAAkB,cAA0C,CAAC;AAC1E;;GAEG;AACH,eAAO,MAAM,iBAAiB,0BAAyC,CAAC;AACxE;;GAEG;AACH,eAAO,MAAM,qBAAqB;kBArClB,WAAW,CAAC,MAAM,CAAC;cACvB,MAAM;CAoC6D,CAAC;AAChF;;GAEG;AACH,eAAO,MAAM,uBAAuB,iCAA+C,CAAC;AACpF;;;GAGG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,SAAS,MAAM,MAAM,GAAG,KAAK,OACjC,KAAK,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAGrD,CAAC;AAEJ;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAS,MAAM,MAAM,GAAG,KAAK,KAClB,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAC3E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,SAAS,MAAM,MAAM,GAAG,KAAK,EAC7D,EAAE,EAAE,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAC3B,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EACjC,QAAQ,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,QAMxF"}
|
|
@@ -1,20 +1,48 @@
|
|
|
1
|
-
import { NavigatorTypeBagBase, ParamListBase, StaticConfig, TypedNavigator } from "@react-navigation/native";
|
|
2
|
-
import React from "react";
|
|
1
|
+
import { type NavigatorTypeBagBase, type ParamListBase, type StaticConfig, type TypedNavigator } from "@react-navigation/native";
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
import type { BottomSheetNavigationEventMap, BottomSheetNavigationOptions, BottomSheetNavigationProp, BottomSheetNavigationState, BottomSheetNavigatorProps } from "./types";
|
|
4
|
-
declare function BottomSheetNavigator({ id, children, screenListeners, screenOptions, ...rest }: BottomSheetNavigatorProps): React.JSX.Element;
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
* and
|
|
5
|
+
* Unified Navigator that renders the first screen as the base content
|
|
6
|
+
* and all subsequent screens as bottom sheet overlays.
|
|
7
|
+
*
|
|
8
|
+
* Uses BottomSheetRouter (extending StackRouter) to manage navigation state,
|
|
9
|
+
* with react-native-screens ScreenStack for the base screen rendering
|
|
10
|
+
* and BottomSheetView for the sheet overlays.
|
|
11
|
+
*/
|
|
12
|
+
declare function Navigator({ id, children, screenListeners, screenOptions, initialRouteName, ...rest }: BottomSheetNavigatorProps): React.JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a bottom sheet navigator that renders the first screen as the
|
|
15
|
+
* main content and all subsequent screens as bottom sheet modals.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // With React Navigation
|
|
20
|
+
* const { Navigator, Screen } = createBottomSheetNavigator();
|
|
21
|
+
*
|
|
22
|
+
* function App() {
|
|
23
|
+
* return (
|
|
24
|
+
* <Navigator>
|
|
25
|
+
* <Screen name="Home" component={HomeScreen} />
|
|
26
|
+
* <Screen
|
|
27
|
+
* name="Details"
|
|
28
|
+
* component={DetailsSheet}
|
|
29
|
+
* options={{ snapPoints: ['50%', '100%'] }}
|
|
30
|
+
* />
|
|
31
|
+
* </Navigator>
|
|
32
|
+
* );
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
8
35
|
*
|
|
9
36
|
* @example
|
|
10
37
|
* ```tsx
|
|
38
|
+
* // With Expo Router
|
|
39
|
+
* import { Slot, withLayoutContext } from "expo-router";
|
|
11
40
|
* import {
|
|
12
41
|
* createBottomSheetNavigator,
|
|
13
42
|
* BottomSheetNavigationOptions,
|
|
14
43
|
* BottomSheetNavigationEventMap,
|
|
15
44
|
* BottomSheetNavigationState,
|
|
16
|
-
* } from "@
|
|
17
|
-
* import { Slot, withLayoutContext } from "expo-router";
|
|
45
|
+
* } from "@niibase/bottom-sheet-manager";
|
|
18
46
|
*
|
|
19
47
|
* const { Navigator } = createBottomSheetNavigator();
|
|
20
48
|
*
|
|
@@ -30,21 +58,22 @@ declare function BottomSheetNavigator({ id, children, screenListeners, screenOpt
|
|
|
30
58
|
* };
|
|
31
59
|
*
|
|
32
60
|
* export default function Layout() {
|
|
61
|
+
* // SSR guard - navigator doesn't work on server
|
|
33
62
|
* if (typeof window === "undefined") return <Slot />;
|
|
63
|
+
*
|
|
34
64
|
* return (
|
|
35
|
-
* <BottomSheet
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*. />
|
|
65
|
+
* <BottomSheet>
|
|
66
|
+
* <BottomSheet.Screen name="index" />
|
|
67
|
+
* <BottomSheet.Screen
|
|
68
|
+
* name="details"
|
|
69
|
+
* options={{ snapPoints: ["50%"] }}
|
|
70
|
+
* />
|
|
71
|
+
* </BottomSheet>
|
|
43
72
|
* );
|
|
44
73
|
* }
|
|
45
74
|
* ```
|
|
46
75
|
*/
|
|
47
|
-
export declare function createBottomSheetNavigator<const ParamList extends ParamListBase, const NavigatorID extends string | undefined = undefined, const TypeBag extends NavigatorTypeBagBase = {
|
|
76
|
+
export declare function createBottomSheetNavigator<const ParamList extends ParamListBase, const NavigatorID extends string | undefined = string | undefined, const TypeBag extends NavigatorTypeBagBase = {
|
|
48
77
|
ParamList: ParamList;
|
|
49
78
|
NavigatorID: NavigatorID;
|
|
50
79
|
State: BottomSheetNavigationState<ParamList>;
|
|
@@ -53,7 +82,8 @@ export declare function createBottomSheetNavigator<const ParamList extends Param
|
|
|
53
82
|
NavigationList: {
|
|
54
83
|
[RouteName in keyof ParamList]: BottomSheetNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
55
84
|
};
|
|
56
|
-
Navigator: typeof
|
|
85
|
+
Navigator: typeof Navigator;
|
|
57
86
|
}, const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>>(config?: Config): TypedNavigator<TypeBag, Config>;
|
|
58
87
|
export * from "./types";
|
|
88
|
+
export { BottomSheetActions, useBottomSheetNavigation } from "./router";
|
|
59
89
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/router/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/router/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAEV,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAIjB;;;;;;;GAOG;AACH,iBAAS,SAAS,CAAC,EACjB,EAAE,EACF,QAAQ,EACR,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,GAAG,IAAI,EACR,EAAE,yBAAyB,qBA8C3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,SAAS,SAAS,aAAa,EACrC,KAAK,CAAC,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EACjE,KAAK,CAAC,OAAO,SAAS,oBAAoB,GAAG;IAC3C,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAC7C,aAAa,EAAE,4BAA4B,CAAC;IAC5C,QAAQ,EAAE,6BAA6B,CAAC;IACxC,cAAc,EAAE;SACb,SAAS,IAAI,MAAM,SAAS,GAAG,yBAAyB,CACvD,SAAS,EACT,SAAS,EACT,WAAW,CACZ;KACF,CAAC;IACF,SAAS,EAAE,OAAO,SAAS,CAAC;CAC7B,EACD,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,CAElD;AAED,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,14 +1,33 @@
|
|
|
1
|
-
import { ParamListBase, Router, StackActionType, StackRouterOptions } from "@react-navigation/native";
|
|
2
|
-
import type { BottomSheetNavigationState } from "./types";
|
|
1
|
+
import { type CommonActions, type ParamListBase, type Router, type StackActionType, type StackRouterOptions } from "@react-navigation/native";
|
|
2
|
+
import type { BottomSheetNavigationProp, BottomSheetNavigationState } from "./types";
|
|
3
3
|
export type BottomSheetRouterOptions = StackRouterOptions;
|
|
4
|
-
export type BottomSheetActionType = StackActionType | {
|
|
4
|
+
export type BottomSheetActionType = StackActionType | ReturnType<typeof CommonActions.goBack> | {
|
|
5
5
|
type: "SNAP_TO";
|
|
6
6
|
index: number;
|
|
7
7
|
source?: string;
|
|
8
8
|
target?: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: "DISMISS";
|
|
11
|
+
source?: string;
|
|
12
|
+
target?: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: "REMOVE";
|
|
15
|
+
source?: string;
|
|
16
|
+
target?: string;
|
|
9
17
|
};
|
|
10
18
|
export declare const BottomSheetActions: {
|
|
11
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Snap the bottom sheet to a specific index.
|
|
21
|
+
*/
|
|
22
|
+
snapTo: (index: number) => BottomSheetActionType;
|
|
23
|
+
/**
|
|
24
|
+
* Dismiss the current bottom sheet.
|
|
25
|
+
*/
|
|
26
|
+
dismiss: () => BottomSheetActionType;
|
|
27
|
+
/**
|
|
28
|
+
* Remove the sheet from navigation state after dismiss animation completes.
|
|
29
|
+
*/
|
|
30
|
+
remove: () => BottomSheetActionType;
|
|
12
31
|
replace(name: string, params?: object): {
|
|
13
32
|
readonly type: "REPLACE";
|
|
14
33
|
readonly payload: {
|
|
@@ -43,5 +62,25 @@ export declare const BottomSheetActions: {
|
|
|
43
62
|
};
|
|
44
63
|
};
|
|
45
64
|
};
|
|
46
|
-
export declare
|
|
65
|
+
export declare const BottomSheetRouter: (routerOptions: StackRouterOptions) => Router<BottomSheetNavigationState<ParamListBase>, BottomSheetActionType>;
|
|
66
|
+
/**
|
|
67
|
+
* Hook to access BottomSheet navigation with the snapTo helper.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* function MySheet() {
|
|
72
|
+
* const navigation = useBottomSheetNavigation();
|
|
73
|
+
*
|
|
74
|
+
* // Snap to a specific index
|
|
75
|
+
* const handleExpand = () => {
|
|
76
|
+
* navigation.snapTo(1); // Snap to second index
|
|
77
|
+
* };
|
|
78
|
+
*
|
|
79
|
+
* return (
|
|
80
|
+
* <Button title="Expand" onPress={handleExpand} />
|
|
81
|
+
* );
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare const useBottomSheetNavigation: <T extends ParamListBase = ParamListBase>() => BottomSheetNavigationProp<T>;
|
|
47
86
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/router/router.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/router/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,aAA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|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { DefaultNavigatorOptions, Descriptor, NavigationHelpers, NavigationProp, NavigationState, ParamListBase, RouteProp, StackActionHelpers, StackNavigationState, StackRouterOptions } from "@react-navigation/native";
|
|
2
|
+
import type { BottomSheetModalProps, SNAP_POINT_TYPE } from "@gorhom/bottom-sheet";
|
|
3
|
+
/**
|
|
4
|
+
* Bottom-sheet-specific screen options.
|
|
5
|
+
* These only take effect when `presentation: "bottomSheet"`.
|
|
6
|
+
*/
|
|
7
|
+
export type BottomSheetScreenOptions = Omit<BottomSheetModalProps, "containerHeight" | "snapPoints" | "gestureEventsHandlersHook" | "iosModalSheetTypeOfAnimation" | "animatedPosition" | "onBeforeShow" | "onChange" | "onClose" | "onDismiss" | "onAnimate" | "children" | "$modal" | "waitFor" | "simultaneousHandlers"> & {
|
|
8
|
+
/**
|
|
9
|
+
* Points for the bottom sheet to snap to.
|
|
10
|
+
* Accepts an array of numbers (pixels) or strings (percentages).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* snapPoints={[200, 500]}
|
|
14
|
+
* snapPoints={[200, '50%']}
|
|
15
|
+
* snapPoints={['100%']}
|
|
16
|
+
*
|
|
17
|
+
* @default ['66%']
|
|
18
|
+
*/
|
|
19
|
+
snapPoints?: Array<string | number>;
|
|
20
|
+
/**
|
|
21
|
+
* When `true`, tapping on the backdrop will not dismiss the sheet.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
passThrough?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Opacity of the backdrop overlay.
|
|
27
|
+
* @default 0.45
|
|
28
|
+
*/
|
|
29
|
+
opacity?: number;
|
|
9
30
|
};
|
|
10
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Navigation options for the bottom sheet navigator.
|
|
33
|
+
*
|
|
34
|
+
* The first screen is rendered as the base content.
|
|
35
|
+
* All subsequent screens are rendered as bottom sheets using these options.
|
|
36
|
+
*/
|
|
37
|
+
export type BottomSheetNavigationOptions = Partial<BottomSheetScreenOptions>;
|
|
38
|
+
/**
|
|
39
|
+
* Navigation events emitted by the bottom sheet navigator.
|
|
40
|
+
*/
|
|
41
|
+
export type BottomSheetNavigationEventMap = {
|
|
42
|
+
/**
|
|
43
|
+
* Event emitted when a sheet is presented.
|
|
44
|
+
*/
|
|
45
|
+
sheetPresent: {
|
|
46
|
+
data: unknown;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Event emitted when a sheet is dismissed.
|
|
50
|
+
*/
|
|
51
|
+
sheetDismiss: {
|
|
52
|
+
data: unknown;
|
|
53
|
+
};
|
|
11
54
|
/**
|
|
12
|
-
*
|
|
55
|
+
* Event emitted when a sheet changes between position/snap points
|
|
13
56
|
*/
|
|
14
|
-
|
|
57
|
+
sheetOnChange: {
|
|
58
|
+
data: {
|
|
59
|
+
index: number;
|
|
60
|
+
position: number;
|
|
61
|
+
type: SNAP_POINT_TYPE;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Event emitted when a sheet animates between snap points.
|
|
66
|
+
*/
|
|
67
|
+
sheetOnAnimate: {
|
|
68
|
+
data: {
|
|
69
|
+
fromIndex: number;
|
|
70
|
+
toIndex: number;
|
|
71
|
+
fromPosition: number;
|
|
72
|
+
toPosition: number;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
15
75
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Extended route type with bottom sheet specific properties.
|
|
78
|
+
*/
|
|
79
|
+
export type BottomSheetRoute<ParamList extends ParamListBase = ParamListBase> = NavigationState<ParamList>["routes"][number] & {
|
|
80
|
+
/**
|
|
81
|
+
* The snap point index the sheet should animate to.
|
|
82
|
+
*/
|
|
83
|
+
snapToIndex?: number | null;
|
|
84
|
+
/**
|
|
85
|
+
* Key to track snap changes for re-rendering.
|
|
86
|
+
*/
|
|
87
|
+
snapToKey?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Whether this route is in the process of being closed.
|
|
90
|
+
*/
|
|
91
|
+
closing?: boolean;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Navigation state type for the bottom sheet navigator.
|
|
95
|
+
*
|
|
96
|
+
* Extends `StackNavigationState` with bottom-sheet-specific route properties
|
|
97
|
+
* and a `"bottom-sheet"` type discriminator.
|
|
98
|
+
*/
|
|
99
|
+
export type BottomSheetNavigationState<ParamList extends ParamListBase = ParamListBase> = Omit<StackNavigationState<ParamList>, "routes" | "type"> & {
|
|
100
|
+
type: "bottom-sheet";
|
|
101
|
+
routes: BottomSheetRoute<ParamList>[];
|
|
20
102
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Action helpers available on the navigation object.
|
|
105
|
+
*/
|
|
106
|
+
export type BottomSheetActionHelpers<ParamList extends ParamListBase> = StackActionHelpers<ParamList> & {
|
|
24
107
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* snapPoints={[200, 500]}
|
|
29
|
-
* snapPoints={[200, '%50']}
|
|
30
|
-
* snapPoints={['%100']}
|
|
31
|
-
* @type Array<string | number>
|
|
108
|
+
* Snap the sheet to a specific point.
|
|
109
|
+
* @param index The snap point index to snap to.
|
|
32
110
|
*/
|
|
33
|
-
|
|
111
|
+
snapTo(index: number): void;
|
|
34
112
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @default false
|
|
113
|
+
* Dismiss the current sheet.
|
|
37
114
|
*/
|
|
38
|
-
|
|
115
|
+
dismiss(): void;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Navigation prop type for screens in the bottom sheet navigator.
|
|
119
|
+
*/
|
|
120
|
+
export type BottomSheetNavigationProp<ParamList extends ParamListBase = ParamListBase, RouteName extends keyof ParamList = string, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, BottomSheetNavigationState<ParamListBase>, BottomSheetNavigationOptions, BottomSheetNavigationEventMap> & BottomSheetActionHelpers<ParamList>;
|
|
121
|
+
/**
|
|
122
|
+
* Props available to screen components in the bottom sheet navigator.
|
|
123
|
+
*/
|
|
124
|
+
export type BottomSheetScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = string, NavigatorID extends string | undefined = undefined> = {
|
|
125
|
+
navigation: BottomSheetNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
126
|
+
route: RouteProp<ParamList, RouteName>;
|
|
39
127
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Navigation helpers type for the bottom sheet navigator.
|
|
130
|
+
*/
|
|
131
|
+
export type BottomSheetNavigationHelpers = NavigationHelpers<ParamListBase, BottomSheetNavigationEventMap> & BottomSheetActionHelpers<ParamListBase>;
|
|
132
|
+
/**
|
|
133
|
+
* Props for the bottom sheet navigator component.
|
|
134
|
+
*/
|
|
135
|
+
export type BottomSheetNavigatorProps = DefaultNavigatorOptions<ParamListBase, string | undefined, BottomSheetNavigationState<ParamListBase>, BottomSheetNavigationOptions, BottomSheetNavigationEventMap, BottomSheetNavigationProp<ParamListBase>> & StackRouterOptions;
|
|
136
|
+
/**
|
|
137
|
+
* Descriptor type for bottom sheet screens.
|
|
138
|
+
*/
|
|
139
|
+
export type BottomSheetDescriptor = Descriptor<BottomSheetNavigationOptions, BottomSheetNavigationProp<ParamListBase, string, undefined>, RouteProp<ParamListBase>>;
|
|
140
|
+
/**
|
|
141
|
+
* Map of route keys to their descriptors.
|
|
142
|
+
*/
|
|
43
143
|
export type BottomSheetDescriptorMap = {
|
|
44
144
|
[key: string]: BottomSheetDescriptor;
|
|
45
145
|
};
|
|
146
|
+
export type BottomSheetModalScreenProps = Omit<BottomSheetModalProps, "onDismiss"> & {
|
|
147
|
+
route: BottomSheetRoute;
|
|
148
|
+
navigation: BottomSheetNavigationHelpers;
|
|
149
|
+
passThrough?: boolean;
|
|
150
|
+
opacity?: number;
|
|
151
|
+
/**
|
|
152
|
+
* Callback when sheet animation changes.
|
|
153
|
+
*/
|
|
154
|
+
onSheetAnimate?: (from: number, to: number) => void;
|
|
155
|
+
};
|
|
46
156
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/router/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/router/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACvC,qBAAqB,EAEnB,iBAAiB,GACjB,YAAY,GACZ,2BAA2B,GAC3B,8BAA8B,GAC9B,kBAAkB,GAClB,cAAc,GACd,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,UAAU,GACV,QAAQ,GACR,SAAS,GACT,sBAAsB,CAC3B,GAAG;IACA;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEpC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IACxC;;OAEG;IACH,YAAY,EAAE;Q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G,EAAE,MAAM,GAAG,qBAAqB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG;IACjF,KAAK,EAAE,gBAAgB,CAAC;IACxB,UAAU,EAAE,4BAA4B,CAAC;IAEzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACvD,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ParamListBase } from "@react-navigation/native";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type { BottomSheetDescriptorMap,
|
|
4
|
-
type Props =
|
|
3
|
+
import type { BottomSheetDescriptorMap, BottomSheetNavigationHelpers, BottomSheetNavigationState } from "./types";
|
|
4
|
+
type Props = {
|
|
5
5
|
state: BottomSheetNavigationState<ParamListBase>;
|
|
6
6
|
navigation: BottomSheetNavigationHelpers;
|
|
7
7
|
descriptors: BottomSheetDescriptorMap;
|
|
8
8
|
};
|
|
9
|
-
export declare function BottomSheetView({ state, descriptors }: Props): React.JSX.Element
|
|
9
|
+
export declare function BottomSheetView({ state, navigation, descriptors }: Props): React.JSX.Element;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/router/view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/router/view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAY,MAAM,0BAA0B,CAAC;AAEnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,wBAAwB,EACxB,4BAA4B,EAC5B,0BAA0B,EAE3B,MAAM,SAAS,CAAC;AAKjB,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,0BAA0B,CAAC,aAAa,CAAC,CAAC;IACjD,UAAU,EAAE,4BAA4B,CAAC;IACzC,WAAW,EAAE,wBAAwB,CAAC;CACvC,CAAC;AAsDF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,KAAK,qBAyFxE"}
|
|
@@ -2,7 +2,7 @@ import { BottomSheetBackdrop, BottomSheetFlatList, BottomSheetFooter, BottomShee
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { BottomSheetInstance, BottomSheetProps, SheetIds } from "./types";
|
|
4
4
|
interface BottomSheetFC extends React.MemoExoticComponent<React.ForwardRefExoticComponent<BottomSheetProps>> {
|
|
5
|
-
<Id extends SheetIds>(props: BottomSheetProps & React.RefAttributes<BottomSheetInstance<Id>>): React.JSX.Element;
|
|
5
|
+
<Id extends SheetIds>(props: BottomSheetProps<Id> & React.RefAttributes<BottomSheetInstance<Id>>): React.JSX.Element;
|
|
6
6
|
View: typeof BottomSheetView;
|
|
7
7
|
ScrollView: typeof BottomSheetScrollView;
|
|
8
8
|
FlatList: typeof BottomSheetFlatList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/sheet.tsx"],"names":[],"mappings":"AAAA,OAAsB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EAEjB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/sheet.tsx"],"names":[],"mappings":"AAAA,OAAsB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EAEjB,qBAAqB,EAC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