@hanzogui/sheet 2.0.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/controller/index.cjs +2 -0
- package/controller/index.d.ts +5 -0
- package/controller/index.js +2 -0
- package/controller/index.native.cjs +2 -0
- package/controller/index.native.js +2 -0
- package/dist/cjs/GestureDetectorWrapper.cjs +48 -0
- package/dist/cjs/GestureDetectorWrapper.native.js +53 -0
- package/dist/cjs/GestureDetectorWrapper.native.js.map +1 -0
- package/dist/cjs/GestureSheetContext.cjs +52 -0
- package/dist/cjs/GestureSheetContext.native.js +56 -0
- package/dist/cjs/GestureSheetContext.native.js.map +1 -0
- package/dist/cjs/Sheet.cjs +117 -0
- package/dist/cjs/Sheet.native.js +120 -0
- package/dist/cjs/Sheet.native.js.map +1 -0
- package/dist/cjs/SheetContext.cjs +32 -0
- package/dist/cjs/SheetContext.native.js +35 -0
- package/dist/cjs/SheetContext.native.js.map +1 -0
- package/dist/cjs/SheetController.cjs +65 -0
- package/dist/cjs/SheetController.native.js +71 -0
- package/dist/cjs/SheetController.native.js.map +1 -0
- package/dist/cjs/SheetImplementationCustom.cjs +472 -0
- package/dist/cjs/SheetImplementationCustom.native.js +524 -0
- package/dist/cjs/SheetImplementationCustom.native.js.map +1 -0
- package/dist/cjs/SheetScrollView.cjs +180 -0
- package/dist/cjs/SheetScrollView.native.js +197 -0
- package/dist/cjs/SheetScrollView.native.js.map +1 -0
- package/dist/cjs/constants.cjs +32 -0
- package/dist/cjs/constants.native.js +35 -0
- package/dist/cjs/constants.native.js.map +1 -0
- package/dist/cjs/contexts.cjs +42 -0
- package/dist/cjs/contexts.native.js +45 -0
- package/dist/cjs/contexts.native.js.map +1 -0
- package/dist/cjs/controller.cjs +29 -0
- package/dist/cjs/controller.native.js +32 -0
- package/dist/cjs/controller.native.js.map +1 -0
- package/dist/cjs/createSheet.cjs +191 -0
- package/dist/cjs/createSheet.native.js +208 -0
- package/dist/cjs/createSheet.native.js.map +1 -0
- package/dist/cjs/gestureState.cjs +39 -0
- package/dist/cjs/gestureState.native.js +42 -0
- package/dist/cjs/gestureState.native.js.map +1 -0
- package/dist/cjs/helpers.cjs +31 -0
- package/dist/cjs/helpers.native.js +35 -0
- package/dist/cjs/helpers.native.js.map +1 -0
- package/dist/cjs/index.cjs +28 -0
- package/dist/cjs/index.native.js +31 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/nativeSheet.cjs +87 -0
- package/dist/cjs/nativeSheet.native.js +101 -0
- package/dist/cjs/nativeSheet.native.js.map +1 -0
- package/dist/cjs/setupGestureHandler.cjs +46 -0
- package/dist/cjs/setupGestureHandler.native.js +50 -0
- package/dist/cjs/setupGestureHandler.native.js.map +1 -0
- package/dist/cjs/types.cjs +16 -0
- package/dist/cjs/types.native.js +19 -0
- package/dist/cjs/types.native.js.map +1 -0
- package/dist/cjs/useGestureHandlerPan.cjs +136 -0
- package/dist/cjs/useGestureHandlerPan.native.js +145 -0
- package/dist/cjs/useGestureHandlerPan.native.js.map +1 -0
- package/dist/cjs/useKeyboardControllerSheet.cjs +38 -0
- package/dist/cjs/useKeyboardControllerSheet.native.js +114 -0
- package/dist/cjs/useKeyboardControllerSheet.native.js.map +1 -0
- package/dist/cjs/useSheet.cjs +27 -0
- package/dist/cjs/useSheet.native.js +32 -0
- package/dist/cjs/useSheet.native.js.map +1 -0
- package/dist/cjs/useSheetController.cjs +50 -0
- package/dist/cjs/useSheetController.native.js +53 -0
- package/dist/cjs/useSheetController.native.js.map +1 -0
- package/dist/cjs/useSheetOffscreenSize.cjs +51 -0
- package/dist/cjs/useSheetOffscreenSize.native.js +61 -0
- package/dist/cjs/useSheetOffscreenSize.native.js.map +1 -0
- package/dist/cjs/useSheetOpenState.cjs +49 -0
- package/dist/cjs/useSheetOpenState.native.js +56 -0
- package/dist/cjs/useSheetOpenState.native.js.map +1 -0
- package/dist/cjs/useSheetProviderProps.cjs +133 -0
- package/dist/cjs/useSheetProviderProps.native.js +153 -0
- package/dist/cjs/useSheetProviderProps.native.js.map +1 -0
- package/dist/cjs/useSheetScrollViewGestures.cjs +123 -0
- package/dist/cjs/useSheetScrollViewGestures.native.js +110 -0
- package/dist/cjs/useSheetScrollViewGestures.native.js.map +1 -0
- package/dist/esm/GestureDetectorWrapper.mjs +25 -0
- package/dist/esm/GestureDetectorWrapper.mjs.map +1 -0
- package/dist/esm/GestureDetectorWrapper.native.js +27 -0
- package/dist/esm/GestureDetectorWrapper.native.js.map +1 -0
- package/dist/esm/GestureSheetContext.mjs +28 -0
- package/dist/esm/GestureSheetContext.mjs.map +1 -0
- package/dist/esm/GestureSheetContext.native.js +29 -0
- package/dist/esm/GestureSheetContext.native.js.map +1 -0
- package/dist/esm/Sheet.mjs +89 -0
- package/dist/esm/Sheet.mjs.map +1 -0
- package/dist/esm/Sheet.native.js +89 -0
- package/dist/esm/Sheet.native.js.map +1 -0
- package/dist/esm/SheetContext.mjs +6 -0
- package/dist/esm/SheetContext.mjs.map +1 -0
- package/dist/esm/SheetContext.native.js +6 -0
- package/dist/esm/SheetContext.native.js.map +1 -0
- package/dist/esm/SheetController.mjs +31 -0
- package/dist/esm/SheetController.mjs.map +1 -0
- package/dist/esm/SheetController.native.js +34 -0
- package/dist/esm/SheetController.native.js.map +1 -0
- package/dist/esm/SheetImplementationCustom.mjs +437 -0
- package/dist/esm/SheetImplementationCustom.mjs.map +1 -0
- package/dist/esm/SheetImplementationCustom.native.js +487 -0
- package/dist/esm/SheetImplementationCustom.native.js.map +1 -0
- package/dist/esm/SheetScrollView.mjs +146 -0
- package/dist/esm/SheetScrollView.mjs.map +1 -0
- package/dist/esm/SheetScrollView.native.js +160 -0
- package/dist/esm/SheetScrollView.native.js.map +1 -0
- package/dist/esm/constants.mjs +6 -0
- package/dist/esm/constants.mjs.map +1 -0
- package/dist/esm/constants.native.js +6 -0
- package/dist/esm/constants.native.js.map +1 -0
- package/dist/esm/contexts.mjs +7 -0
- package/dist/esm/contexts.mjs.map +1 -0
- package/dist/esm/contexts.native.js +7 -0
- package/dist/esm/contexts.native.js.map +1 -0
- package/dist/esm/controller.mjs +4 -0
- package/dist/esm/controller.mjs.map +1 -0
- package/dist/esm/controller.native.js +4 -0
- package/dist/esm/controller.native.js.map +1 -0
- package/dist/esm/createSheet.mjs +168 -0
- package/dist/esm/createSheet.mjs.map +1 -0
- package/dist/esm/createSheet.native.js +182 -0
- package/dist/esm/createSheet.native.js.map +1 -0
- package/dist/esm/gestureState.mjs +13 -0
- package/dist/esm/gestureState.mjs.map +1 -0
- package/dist/esm/gestureState.native.js +13 -0
- package/dist/esm/gestureState.native.js.map +1 -0
- package/dist/esm/helpers.mjs +8 -0
- package/dist/esm/helpers.mjs.map +1 -0
- package/dist/esm/helpers.native.js +9 -0
- package/dist/esm/helpers.native.js.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +12 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +12 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/nativeSheet.mjs +63 -0
- package/dist/esm/nativeSheet.mjs.map +1 -0
- package/dist/esm/nativeSheet.native.js +74 -0
- package/dist/esm/nativeSheet.native.js.map +1 -0
- package/dist/esm/setupGestureHandler.mjs +22 -0
- package/dist/esm/setupGestureHandler.mjs.map +1 -0
- package/dist/esm/setupGestureHandler.native.js +23 -0
- package/dist/esm/setupGestureHandler.native.js.map +1 -0
- package/dist/esm/types.mjs +2 -0
- package/dist/esm/types.mjs.map +1 -0
- package/dist/esm/types.native.js +2 -0
- package/dist/esm/types.native.js.map +1 -0
- package/dist/esm/useGestureHandlerPan.mjs +113 -0
- package/dist/esm/useGestureHandlerPan.mjs.map +1 -0
- package/dist/esm/useGestureHandlerPan.native.js +119 -0
- package/dist/esm/useGestureHandlerPan.native.js.map +1 -0
- package/dist/esm/useKeyboardControllerSheet.mjs +15 -0
- package/dist/esm/useKeyboardControllerSheet.mjs.map +1 -0
- package/dist/esm/useKeyboardControllerSheet.native.js +88 -0
- package/dist/esm/useKeyboardControllerSheet.native.js.map +1 -0
- package/dist/esm/useSheet.mjs +4 -0
- package/dist/esm/useSheet.mjs.map +1 -0
- package/dist/esm/useSheet.native.js +6 -0
- package/dist/esm/useSheet.native.js.map +1 -0
- package/dist/esm/useSheetController.mjs +15 -0
- package/dist/esm/useSheetController.mjs.map +1 -0
- package/dist/esm/useSheetController.native.js +15 -0
- package/dist/esm/useSheetController.native.js.map +1 -0
- package/dist/esm/useSheetOffscreenSize.mjs +28 -0
- package/dist/esm/useSheetOffscreenSize.mjs.map +1 -0
- package/dist/esm/useSheetOffscreenSize.native.js +35 -0
- package/dist/esm/useSheetOffscreenSize.native.js.map +1 -0
- package/dist/esm/useSheetOpenState.mjs +26 -0
- package/dist/esm/useSheetOpenState.mjs.map +1 -0
- package/dist/esm/useSheetOpenState.native.js +30 -0
- package/dist/esm/useSheetOpenState.native.js.map +1 -0
- package/dist/esm/useSheetProviderProps.mjs +99 -0
- package/dist/esm/useSheetProviderProps.mjs.map +1 -0
- package/dist/esm/useSheetProviderProps.native.js +116 -0
- package/dist/esm/useSheetProviderProps.native.js.map +1 -0
- package/dist/esm/useSheetScrollViewGestures.mjs +100 -0
- package/dist/esm/useSheetScrollViewGestures.mjs.map +1 -0
- package/dist/esm/useSheetScrollViewGestures.native.js +84 -0
- package/dist/esm/useSheetScrollViewGestures.native.js.map +1 -0
- package/dist/jsx/GestureDetectorWrapper.mjs +25 -0
- package/dist/jsx/GestureDetectorWrapper.mjs.map +1 -0
- package/dist/jsx/GestureDetectorWrapper.native.js +53 -0
- package/dist/jsx/GestureDetectorWrapper.native.js.map +1 -0
- package/dist/jsx/GestureSheetContext.mjs +28 -0
- package/dist/jsx/GestureSheetContext.mjs.map +1 -0
- package/dist/jsx/GestureSheetContext.native.js +56 -0
- package/dist/jsx/GestureSheetContext.native.js.map +1 -0
- package/dist/jsx/Sheet.mjs +89 -0
- package/dist/jsx/Sheet.mjs.map +1 -0
- package/dist/jsx/Sheet.native.js +120 -0
- package/dist/jsx/Sheet.native.js.map +1 -0
- package/dist/jsx/SheetContext.mjs +6 -0
- package/dist/jsx/SheetContext.mjs.map +1 -0
- package/dist/jsx/SheetContext.native.js +35 -0
- package/dist/jsx/SheetContext.native.js.map +1 -0
- package/dist/jsx/SheetController.mjs +31 -0
- package/dist/jsx/SheetController.mjs.map +1 -0
- package/dist/jsx/SheetController.native.js +71 -0
- package/dist/jsx/SheetController.native.js.map +1 -0
- package/dist/jsx/SheetImplementationCustom.mjs +437 -0
- package/dist/jsx/SheetImplementationCustom.mjs.map +1 -0
- package/dist/jsx/SheetImplementationCustom.native.js +524 -0
- package/dist/jsx/SheetImplementationCustom.native.js.map +1 -0
- package/dist/jsx/SheetScrollView.mjs +146 -0
- package/dist/jsx/SheetScrollView.mjs.map +1 -0
- package/dist/jsx/SheetScrollView.native.js +197 -0
- package/dist/jsx/SheetScrollView.native.js.map +1 -0
- package/dist/jsx/constants.mjs +6 -0
- package/dist/jsx/constants.mjs.map +1 -0
- package/dist/jsx/constants.native.js +35 -0
- package/dist/jsx/constants.native.js.map +1 -0
- package/dist/jsx/contexts.mjs +7 -0
- package/dist/jsx/contexts.mjs.map +1 -0
- package/dist/jsx/contexts.native.js +45 -0
- package/dist/jsx/contexts.native.js.map +1 -0
- package/dist/jsx/controller.mjs +4 -0
- package/dist/jsx/controller.mjs.map +1 -0
- package/dist/jsx/controller.native.js +32 -0
- package/dist/jsx/controller.native.js.map +1 -0
- package/dist/jsx/createSheet.mjs +168 -0
- package/dist/jsx/createSheet.mjs.map +1 -0
- package/dist/jsx/createSheet.native.js +208 -0
- package/dist/jsx/createSheet.native.js.map +1 -0
- package/dist/jsx/gestureState.mjs +13 -0
- package/dist/jsx/gestureState.mjs.map +1 -0
- package/dist/jsx/gestureState.native.js +42 -0
- package/dist/jsx/gestureState.native.js.map +1 -0
- package/dist/jsx/helpers.mjs +8 -0
- package/dist/jsx/helpers.mjs.map +1 -0
- package/dist/jsx/helpers.native.js +35 -0
- package/dist/jsx/helpers.native.js.map +1 -0
- package/dist/jsx/index.js +12 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/index.mjs +12 -0
- package/dist/jsx/index.mjs.map +1 -0
- package/dist/jsx/index.native.js +31 -0
- package/dist/jsx/index.native.js.map +1 -0
- package/dist/jsx/nativeSheet.mjs +63 -0
- package/dist/jsx/nativeSheet.mjs.map +1 -0
- package/dist/jsx/nativeSheet.native.js +101 -0
- package/dist/jsx/nativeSheet.native.js.map +1 -0
- package/dist/jsx/setupGestureHandler.mjs +22 -0
- package/dist/jsx/setupGestureHandler.mjs.map +1 -0
- package/dist/jsx/setupGestureHandler.native.js +50 -0
- package/dist/jsx/setupGestureHandler.native.js.map +1 -0
- package/dist/jsx/types.mjs +2 -0
- package/dist/jsx/types.mjs.map +1 -0
- package/dist/jsx/types.native.js +19 -0
- package/dist/jsx/types.native.js.map +1 -0
- package/dist/jsx/useGestureHandlerPan.mjs +113 -0
- package/dist/jsx/useGestureHandlerPan.mjs.map +1 -0
- package/dist/jsx/useGestureHandlerPan.native.js +145 -0
- package/dist/jsx/useGestureHandlerPan.native.js.map +1 -0
- package/dist/jsx/useKeyboardControllerSheet.mjs +15 -0
- package/dist/jsx/useKeyboardControllerSheet.mjs.map +1 -0
- package/dist/jsx/useKeyboardControllerSheet.native.js +114 -0
- package/dist/jsx/useKeyboardControllerSheet.native.js.map +1 -0
- package/dist/jsx/useSheet.mjs +4 -0
- package/dist/jsx/useSheet.mjs.map +1 -0
- package/dist/jsx/useSheet.native.js +32 -0
- package/dist/jsx/useSheet.native.js.map +1 -0
- package/dist/jsx/useSheetController.mjs +15 -0
- package/dist/jsx/useSheetController.mjs.map +1 -0
- package/dist/jsx/useSheetController.native.js +53 -0
- package/dist/jsx/useSheetController.native.js.map +1 -0
- package/dist/jsx/useSheetOffscreenSize.mjs +28 -0
- package/dist/jsx/useSheetOffscreenSize.mjs.map +1 -0
- package/dist/jsx/useSheetOffscreenSize.native.js +61 -0
- package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -0
- package/dist/jsx/useSheetOpenState.mjs +26 -0
- package/dist/jsx/useSheetOpenState.mjs.map +1 -0
- package/dist/jsx/useSheetOpenState.native.js +56 -0
- package/dist/jsx/useSheetOpenState.native.js.map +1 -0
- package/dist/jsx/useSheetProviderProps.mjs +99 -0
- package/dist/jsx/useSheetProviderProps.mjs.map +1 -0
- package/dist/jsx/useSheetProviderProps.native.js +153 -0
- package/dist/jsx/useSheetProviderProps.native.js.map +1 -0
- package/dist/jsx/useSheetScrollViewGestures.mjs +100 -0
- package/dist/jsx/useSheetScrollViewGestures.mjs.map +1 -0
- package/dist/jsx/useSheetScrollViewGestures.native.js +110 -0
- package/dist/jsx/useSheetScrollViewGestures.native.js.map +1 -0
- package/next.md +78 -0
- package/package.json +96 -0
- package/setup-gesture-handler/index.cjs +2 -0
- package/setup-gesture-handler/index.js +2 -0
- package/setup-gesture-handler/index.native.cjs +2 -0
- package/setup-gesture-handler/index.native.js +2 -0
- package/setup-gesture-handler.cjs +1 -0
- package/src/GestureDetectorWrapper.tsx +41 -0
- package/src/GestureSheetContext.tsx +62 -0
- package/src/Sheet.tsx +114 -0
- package/src/SheetContext.tsx +11 -0
- package/src/SheetController.tsx +44 -0
- package/src/SheetImplementationCustom.tsx +868 -0
- package/src/SheetScrollView.tsx +195 -0
- package/src/constants.tsx +5 -0
- package/src/contexts.ts +9 -0
- package/src/controller.ts +9 -0
- package/src/createSheet.tsx +296 -0
- package/src/gestureState.ts +24 -0
- package/src/helpers.tsx +31 -0
- package/src/index.ts +11 -0
- package/src/nativeSheet.tsx +89 -0
- package/src/setupGestureHandler.ts +34 -0
- package/src/types.tsx +181 -0
- package/src/useGestureHandlerPan.tsx +364 -0
- package/src/useKeyboardControllerSheet.native.ts +136 -0
- package/src/useKeyboardControllerSheet.ts +26 -0
- package/src/useSheet.tsx +3 -0
- package/src/useSheetController.tsx +27 -0
- package/src/useSheetOffscreenSize.tsx +49 -0
- package/src/useSheetOpenState.tsx +33 -0
- package/src/useSheetProviderProps.tsx +223 -0
- package/src/useSheetScrollViewGestures.native.ts +163 -0
- package/src/useSheetScrollViewGestures.ts +194 -0
- package/tsconfig.json +56 -0
- package/types/GestureDetectorWrapper.d.ts +14 -0
- package/types/GestureSheetContext.d.ts +36 -0
- package/types/Sheet.d.ts +183 -0
- package/types/SheetContext.d.ts +43 -0
- package/types/SheetController.d.ts +6 -0
- package/types/SheetImplementationCustom.d.ts +36 -0
- package/types/SheetScrollView.d.ts +40 -0
- package/types/constants.d.ts +5 -0
- package/types/contexts.d.ts +6 -0
- package/types/controller.d.ts +3 -0
- package/types/createSheet.d.ts +194 -0
- package/types/gestureState.d.ts +11 -0
- package/types/helpers.d.ts +2 -0
- package/types/index.d.ts +12 -0
- package/types/nativeSheet.d.ts +10 -0
- package/types/setupGestureHandler.d.ts +11 -0
- package/types/types.d.ts +147 -0
- package/types/useGestureHandlerPan.d.ts +44 -0
- package/types/useKeyboardControllerSheet.d.ts +7 -0
- package/types/useKeyboardControllerSheet.native.d.ts +13 -0
- package/types/useSheet.d.ts +2 -0
- package/types/useSheetController.d.ts +17 -0
- package/types/useSheetOffscreenSize.d.ts +3 -0
- package/types/useSheetOpenState.d.ts +9 -0
- package/types/useSheetProviderProps.d.ts +36 -0
- package/types/useSheetScrollViewGestures.d.ts +12 -0
- package/types/useSheetScrollViewGestures.native.d.ts +21 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { GetProps, ViewProps, GuiComponent, GuiComponentExpectingVariants } from '@gui/core';
|
|
2
|
+
import type { ForwardRefExoticComponent, FunctionComponent, RefAttributes } from 'react';
|
|
3
|
+
import type { View as RNView } from 'react-native';
|
|
4
|
+
import type { SheetProps, SheetScopedProps } from './types';
|
|
5
|
+
type SharedSheetProps = {
|
|
6
|
+
open?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type BaseProps = ViewProps & SharedSheetProps;
|
|
9
|
+
type SheetStyledComponent = GuiComponentExpectingVariants<BaseProps, SharedSheetProps>;
|
|
10
|
+
export declare function createSheet<H extends GuiComponent | SheetStyledComponent, F extends GuiComponent | SheetStyledComponent, O extends GuiComponent | SheetStyledComponent>({ Handle, Frame, Overlay }: {
|
|
11
|
+
Handle: H;
|
|
12
|
+
Frame: F;
|
|
13
|
+
Overlay: O;
|
|
14
|
+
}): ForwardRefExoticComponent<{
|
|
15
|
+
open?: boolean;
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
onOpenChange?: import("react").Dispatch<import("react").SetStateAction<boolean>> | ((open: boolean) => void);
|
|
18
|
+
position?: number;
|
|
19
|
+
defaultPosition?: number;
|
|
20
|
+
snapPoints?: (string | number)[];
|
|
21
|
+
snapPointsMode?: import("./types").SnapPointsMode;
|
|
22
|
+
onPositionChange?: import("./types").PositionChangeHandler;
|
|
23
|
+
children?: import("react").ReactNode;
|
|
24
|
+
dismissOnOverlayPress?: boolean;
|
|
25
|
+
dismissOnSnapToBottom?: boolean;
|
|
26
|
+
disableRemoveScroll?: boolean;
|
|
27
|
+
forceRemoveScrollEnabled?: boolean;
|
|
28
|
+
transitionConfig?: import("@gui/core").AnimatedNumberStrategy;
|
|
29
|
+
preferAdaptParentOpenState?: boolean;
|
|
30
|
+
unmountChildrenWhenHidden?: boolean;
|
|
31
|
+
native?: "ios"[] | boolean;
|
|
32
|
+
transition?: import("@gui/core").TransitionProp;
|
|
33
|
+
handleDisableScroll?: boolean;
|
|
34
|
+
disableDrag?: boolean;
|
|
35
|
+
modal?: boolean;
|
|
36
|
+
zIndex?: number;
|
|
37
|
+
portalProps?: import("@gui/portal").PortalProps;
|
|
38
|
+
moveOnKeyboardChange?: boolean;
|
|
39
|
+
containerComponent?: React.ComponentType<any>;
|
|
40
|
+
onAnimationComplete?: (info: {
|
|
41
|
+
open: boolean;
|
|
42
|
+
}) => void;
|
|
43
|
+
} & {
|
|
44
|
+
__scopeSheet?: import("@gui/create-context").Scope<any>;
|
|
45
|
+
} & RefAttributes<RNView>> & {
|
|
46
|
+
Controlled: FunctionComponent<Omit<SheetProps, "open" | "onOpenChange"> & RefAttributes<RNView>> & {
|
|
47
|
+
Frame: ForwardRefExoticComponent<SheetScopedProps<Omit<GetProps<F>, keyof {
|
|
48
|
+
/**
|
|
49
|
+
* By default the sheet adds a view below its bottom that extends down another 50%,
|
|
50
|
+
* this is useful if your Sheet has a spring animation that bounces "past" the top when
|
|
51
|
+
* opening, preventing it from showing the content underneath.
|
|
52
|
+
*/
|
|
53
|
+
disableHideBottomOverflow?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Adds padding accounting for the currently offscreen content, so if you put a flex element inside
|
|
56
|
+
* the sheet, it will always flex to the height of the visible amount of the sheet. If this is not
|
|
57
|
+
* turned on, the inner content is always set to the max height of the sheet.
|
|
58
|
+
*/
|
|
59
|
+
adjustPaddingForOffscreenContent?: boolean;
|
|
60
|
+
}> & {
|
|
61
|
+
/**
|
|
62
|
+
* By default the sheet adds a view below its bottom that extends down another 50%,
|
|
63
|
+
* this is useful if your Sheet has a spring animation that bounces "past" the top when
|
|
64
|
+
* opening, preventing it from showing the content underneath.
|
|
65
|
+
*/
|
|
66
|
+
disableHideBottomOverflow?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Adds padding accounting for the currently offscreen content, so if you put a flex element inside
|
|
69
|
+
* the sheet, it will always flex to the height of the visible amount of the sheet. If this is not
|
|
70
|
+
* turned on, the inner content is always set to the max height of the sheet.
|
|
71
|
+
*/
|
|
72
|
+
adjustPaddingForOffscreenContent?: boolean;
|
|
73
|
+
}>>;
|
|
74
|
+
Overlay: GuiComponent<Omit<BaseProps, "__scopeSheet"> & {
|
|
75
|
+
__scopeSheet?: import("@gui/create-context").Scope<any>;
|
|
76
|
+
}, any, any, any, SharedSheetProps, {}> | GuiComponent<Omit<BaseProps, "__scopeSheet"> & {
|
|
77
|
+
__scopeSheet?: import("@gui/create-context").Scope<any>;
|
|
78
|
+
}, any, {
|
|
79
|
+
__scopeSheet?: import("@gui/create-context").Scope<any>;
|
|
80
|
+
}, {}, {}, {}>;
|
|
81
|
+
Handle: GuiComponent<any, any, any, any, SharedSheetProps, {}> | GuiComponent<any, any, any, {}, {}, {}>;
|
|
82
|
+
ScrollView: ForwardRefExoticComponent<Omit<import("@gui/core").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@gui/core").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
|
|
83
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
84
|
+
accept: {
|
|
85
|
+
readonly contentContainerStyle: "style";
|
|
86
|
+
};
|
|
87
|
+
}>> | undefined;
|
|
88
|
+
}> & {
|
|
89
|
+
fullscreen?: boolean | undefined;
|
|
90
|
+
} & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
|
|
91
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
92
|
+
accept: {
|
|
93
|
+
readonly contentContainerStyle: "style";
|
|
94
|
+
};
|
|
95
|
+
}>> | undefined;
|
|
96
|
+
}>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
|
|
97
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
98
|
+
accept: {
|
|
99
|
+
readonly contentContainerStyle: "style";
|
|
100
|
+
};
|
|
101
|
+
}>> | undefined;
|
|
102
|
+
}> & {
|
|
103
|
+
fullscreen?: boolean | undefined;
|
|
104
|
+
} & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
|
|
105
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
106
|
+
accept: {
|
|
107
|
+
readonly contentContainerStyle: "style";
|
|
108
|
+
};
|
|
109
|
+
}>> | undefined;
|
|
110
|
+
}>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase & {
|
|
111
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
112
|
+
accept: {
|
|
113
|
+
readonly contentContainerStyle: "style";
|
|
114
|
+
};
|
|
115
|
+
}>> | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
fullscreen?: boolean | undefined;
|
|
118
|
+
}>> & RefAttributes<import("react-native").ScrollView>>;
|
|
119
|
+
};
|
|
120
|
+
Frame: ForwardRefExoticComponent<SheetScopedProps<Omit<GetProps<F>, keyof {
|
|
121
|
+
/**
|
|
122
|
+
* By default the sheet adds a view below its bottom that extends down another 50%,
|
|
123
|
+
* this is useful if your Sheet has a spring animation that bounces "past" the top when
|
|
124
|
+
* opening, preventing it from showing the content underneath.
|
|
125
|
+
*/
|
|
126
|
+
disableHideBottomOverflow?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Adds padding accounting for the currently offscreen content, so if you put a flex element inside
|
|
129
|
+
* the sheet, it will always flex to the height of the visible amount of the sheet. If this is not
|
|
130
|
+
* turned on, the inner content is always set to the max height of the sheet.
|
|
131
|
+
*/
|
|
132
|
+
adjustPaddingForOffscreenContent?: boolean;
|
|
133
|
+
}> & {
|
|
134
|
+
/**
|
|
135
|
+
* By default the sheet adds a view below its bottom that extends down another 50%,
|
|
136
|
+
* this is useful if your Sheet has a spring animation that bounces "past" the top when
|
|
137
|
+
* opening, preventing it from showing the content underneath.
|
|
138
|
+
*/
|
|
139
|
+
disableHideBottomOverflow?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Adds padding accounting for the currently offscreen content, so if you put a flex element inside
|
|
142
|
+
* the sheet, it will always flex to the height of the visible amount of the sheet. If this is not
|
|
143
|
+
* turned on, the inner content is always set to the max height of the sheet.
|
|
144
|
+
*/
|
|
145
|
+
adjustPaddingForOffscreenContent?: boolean;
|
|
146
|
+
}>>;
|
|
147
|
+
Overlay: GuiComponent<Omit<BaseProps, "__scopeSheet"> & {
|
|
148
|
+
__scopeSheet?: import("@gui/create-context").Scope<any>;
|
|
149
|
+
}, any, any, any, SharedSheetProps, {}> | GuiComponent<Omit<BaseProps, "__scopeSheet"> & {
|
|
150
|
+
__scopeSheet?: import("@gui/create-context").Scope<any>;
|
|
151
|
+
}, any, {
|
|
152
|
+
__scopeSheet?: import("@gui/create-context").Scope<any>;
|
|
153
|
+
}, {}, {}, {}>;
|
|
154
|
+
Handle: GuiComponent<any, any, any, any, SharedSheetProps, {}> | GuiComponent<any, any, any, {}, {}, {}>;
|
|
155
|
+
ScrollView: ForwardRefExoticComponent<Omit<import("@gui/core").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@gui/core").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
|
|
156
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
157
|
+
accept: {
|
|
158
|
+
readonly contentContainerStyle: "style";
|
|
159
|
+
};
|
|
160
|
+
}>> | undefined;
|
|
161
|
+
}> & {
|
|
162
|
+
fullscreen?: boolean | undefined;
|
|
163
|
+
} & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
|
|
164
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
165
|
+
accept: {
|
|
166
|
+
readonly contentContainerStyle: "style";
|
|
167
|
+
};
|
|
168
|
+
}>> | undefined;
|
|
169
|
+
}>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
|
|
170
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
171
|
+
accept: {
|
|
172
|
+
readonly contentContainerStyle: "style";
|
|
173
|
+
};
|
|
174
|
+
}>> | undefined;
|
|
175
|
+
}> & {
|
|
176
|
+
fullscreen?: boolean | undefined;
|
|
177
|
+
} & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase & {
|
|
178
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
179
|
+
accept: {
|
|
180
|
+
readonly contentContainerStyle: "style";
|
|
181
|
+
};
|
|
182
|
+
}>> | undefined;
|
|
183
|
+
}>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase & {
|
|
184
|
+
readonly contentContainerStyle?: Partial<import("@gui/core").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
185
|
+
accept: {
|
|
186
|
+
readonly contentContainerStyle: "style";
|
|
187
|
+
};
|
|
188
|
+
}>> | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
fullscreen?: boolean | undefined;
|
|
191
|
+
}>> & RefAttributes<import("react-native").ScrollView>>;
|
|
192
|
+
};
|
|
193
|
+
export {};
|
|
194
|
+
//# sourceMappingURL=createSheet.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export gesture state from @gui/native.
|
|
3
|
+
* Sheet uses this for backward compatibility with existing code.
|
|
4
|
+
*/
|
|
5
|
+
import { type GestureState } from '@gui/native';
|
|
6
|
+
export type { GestureState as GestureHandlerState } from '@gui/native';
|
|
7
|
+
export declare function isGestureHandlerEnabled(): boolean;
|
|
8
|
+
export declare function getGestureHandlerState(): GestureState;
|
|
9
|
+
export declare function setGestureHandlerState(updates: Partial<GestureState>): void;
|
|
10
|
+
export declare const setGestureState: typeof setGestureHandlerState;
|
|
11
|
+
//# sourceMappingURL=gestureState.d.ts.map
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './Sheet';
|
|
2
|
+
export * from './useSheet';
|
|
3
|
+
export * from './createSheet';
|
|
4
|
+
export * from './SheetController';
|
|
5
|
+
export * from './useSheetController';
|
|
6
|
+
export * from './useSheetOpenState';
|
|
7
|
+
export * from './useSheetOffscreenSize';
|
|
8
|
+
export * from './SheetScrollView';
|
|
9
|
+
export * from './nativeSheet';
|
|
10
|
+
export * from './types';
|
|
11
|
+
export * from './contexts';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import type { SheetProps } from './types';
|
|
3
|
+
type SheetNativePlatforms = 'ios';
|
|
4
|
+
export declare function getNativeSheet(platform: SheetNativePlatforms): FunctionComponent<SheetProps> | null;
|
|
5
|
+
export declare function setupNativeSheet(platform: SheetNativePlatforms, RNIOSModal: {
|
|
6
|
+
ModalSheetView: any;
|
|
7
|
+
ModalSheetViewMainContent: any;
|
|
8
|
+
}): void;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=nativeSheet.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy setup - prefer `import '@gui/native/setup-gesture-handler'` instead.
|
|
3
|
+
*/
|
|
4
|
+
export declare function isGestureHandlerEnabled(): boolean;
|
|
5
|
+
export interface SetupGestureHandlerConfig {
|
|
6
|
+
Gesture: any;
|
|
7
|
+
GestureDetector: any;
|
|
8
|
+
ScrollView?: any;
|
|
9
|
+
}
|
|
10
|
+
export declare function setupGestureHandler(config: SetupGestureHandlerConfig): void;
|
|
11
|
+
//# sourceMappingURL=setupGestureHandler.d.ts.map
|
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { AnimatedNumberStrategy, TransitionProp } from '@gui/core';
|
|
2
|
+
import type { ScopedProps } from '@gui/create-context';
|
|
3
|
+
import type { PortalProps } from '@gui/portal';
|
|
4
|
+
import type { RemoveScroll } from '@gui/remove-scroll';
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
import type React from 'react';
|
|
7
|
+
export type SheetProps = ScopedProps<{
|
|
8
|
+
open?: boolean;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onOpenChange?: OpenChangeHandler;
|
|
11
|
+
/**
|
|
12
|
+
* Control the index of the position in the `snapPoints` array
|
|
13
|
+
*/
|
|
14
|
+
position?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Initial position from the `snapPoints` array
|
|
17
|
+
*/
|
|
18
|
+
defaultPosition?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Array of pixels or percents the Sheet will attempt to move to when dragged.
|
|
21
|
+
* The first is the topmost and default when first opened via open prop.
|
|
22
|
+
*/
|
|
23
|
+
snapPoints?: (string | number)[];
|
|
24
|
+
snapPointsMode?: SnapPointsMode;
|
|
25
|
+
onPositionChange?: PositionChangeHandler;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
dismissOnOverlayPress?: boolean;
|
|
28
|
+
dismissOnSnapToBottom?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Disables the RemoveScroll behavior that prevents body scrolling while sheet is open.
|
|
31
|
+
* By default, RemoveScroll is enabled when the sheet is open and modal.
|
|
32
|
+
*/
|
|
33
|
+
disableRemoveScroll?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use `disableRemoveScroll` instead. This prop will be removed in a future version.
|
|
36
|
+
* Note: `disableRemoveScroll={true}` is equivalent to `forceRemoveScrollEnabled={false}`
|
|
37
|
+
*/
|
|
38
|
+
forceRemoveScrollEnabled?: boolean;
|
|
39
|
+
transitionConfig?: AnimatedNumberStrategy;
|
|
40
|
+
/**
|
|
41
|
+
* By default Sheet will prefer the open prop over a parent component that is
|
|
42
|
+
* controlling it via Adapt. In general if you want to Adapt to a sheet, you'd
|
|
43
|
+
* leave the open prop undefined. If you'd like to have the parent override the
|
|
44
|
+
* prop you've set manually on Sheet, set this to true.
|
|
45
|
+
*/
|
|
46
|
+
preferAdaptParentOpenState?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* (experimental) Remove the children while hidden (to save some performance, but can cause issues with animations)
|
|
49
|
+
*/
|
|
50
|
+
unmountChildrenWhenHidden?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Adapts the sheet to use native sheet on the given platform (if available)
|
|
53
|
+
*/
|
|
54
|
+
native?: 'ios'[] | boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Pass if you're using the CSS animation driver
|
|
57
|
+
*/
|
|
58
|
+
transition?: TransitionProp;
|
|
59
|
+
handleDisableScroll?: boolean;
|
|
60
|
+
disableDrag?: boolean;
|
|
61
|
+
modal?: boolean;
|
|
62
|
+
zIndex?: number;
|
|
63
|
+
portalProps?: PortalProps;
|
|
64
|
+
/**
|
|
65
|
+
* Native-only flag that will make the sheet move up when the mobile keyboard opens so the focused input remains visible
|
|
66
|
+
*/
|
|
67
|
+
moveOnKeyboardChange?: boolean;
|
|
68
|
+
containerComponent?: React.ComponentType<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Called when the sheet open/close animation completes.
|
|
71
|
+
*/
|
|
72
|
+
onAnimationComplete?: (info: {
|
|
73
|
+
open: boolean;
|
|
74
|
+
}) => void;
|
|
75
|
+
}, 'Sheet'>;
|
|
76
|
+
export type PositionChangeHandler = (position: number) => void;
|
|
77
|
+
type OpenChangeHandler = ((open: boolean) => void) | React.Dispatch<React.SetStateAction<boolean>>;
|
|
78
|
+
export type RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;
|
|
79
|
+
export type SnapPointsMode = 'percent' | 'constant' | 'fit' | 'mixed';
|
|
80
|
+
export type SheetScopedProps<A> = ScopedProps<A, 'Sheet'>;
|
|
81
|
+
export type ScrollBridge = {
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
y: number;
|
|
84
|
+
paneY: number;
|
|
85
|
+
paneMinY: number;
|
|
86
|
+
scrollStartY: number;
|
|
87
|
+
hasScrollableContent: boolean;
|
|
88
|
+
drag: (dy: number) => void;
|
|
89
|
+
release: (state: {
|
|
90
|
+
dragAt: number;
|
|
91
|
+
vy: number;
|
|
92
|
+
}) => void;
|
|
93
|
+
scrollLock: boolean;
|
|
94
|
+
isParentDragging: boolean;
|
|
95
|
+
onParentDragging: (props: (val: boolean) => void) => () => void;
|
|
96
|
+
setParentDragging: (val: boolean) => void;
|
|
97
|
+
onFinishAnimate?: () => void;
|
|
98
|
+
blockPan?: boolean;
|
|
99
|
+
initialPosition?: number;
|
|
100
|
+
isScrollablePositionLocked?: boolean;
|
|
101
|
+
setScrollEnabled?: (enabled: boolean, lockTo?: number) => void;
|
|
102
|
+
_lastTouchY?: number;
|
|
103
|
+
scrollLockY?: number;
|
|
104
|
+
forceScrollTo?: (y: number) => void;
|
|
105
|
+
isAtTop?: boolean;
|
|
106
|
+
snapToPosition?: (positionIndex: number) => void;
|
|
107
|
+
};
|
|
108
|
+
export interface KeyboardControllerSheetOptions {
|
|
109
|
+
/**
|
|
110
|
+
* Whether keyboard handling is enabled.
|
|
111
|
+
* When false, the hook is a no-op.
|
|
112
|
+
*/
|
|
113
|
+
enabled: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface KeyboardControllerSheetResult {
|
|
116
|
+
/**
|
|
117
|
+
* Whether keyboard-controller is available and enabled.
|
|
118
|
+
*/
|
|
119
|
+
keyboardControllerEnabled: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Current keyboard height (0 when hidden).
|
|
122
|
+
* On web or when keyboard-controller is not available, always 0.
|
|
123
|
+
*/
|
|
124
|
+
keyboardHeight: number;
|
|
125
|
+
/**
|
|
126
|
+
* Whether the keyboard is currently visible.
|
|
127
|
+
*/
|
|
128
|
+
isKeyboardVisible: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Dismiss the keyboard programmatically.
|
|
131
|
+
* Called when sheet closes to dismiss the keyboard.
|
|
132
|
+
*/
|
|
133
|
+
dismissKeyboard: () => void;
|
|
134
|
+
/**
|
|
135
|
+
* Ref to pause keyboard hide state updates (action-sheet pattern).
|
|
136
|
+
* When true, keyboard hide events are ignored — keeps isKeyboardVisible=true
|
|
137
|
+
* and keyboardHeight at their last values during drag.
|
|
138
|
+
*/
|
|
139
|
+
pauseKeyboardHandler: React.RefObject<boolean>;
|
|
140
|
+
/**
|
|
141
|
+
* Flush any keyboard hide event that was suppressed while paused.
|
|
142
|
+
* Call after drag ends to reconcile actual keyboard state.
|
|
143
|
+
*/
|
|
144
|
+
flushPendingHide: () => void;
|
|
145
|
+
}
|
|
146
|
+
export {};
|
|
147
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { ScrollBridge } from './types';
|
|
3
|
+
interface GesturePanConfig {
|
|
4
|
+
positions: number[];
|
|
5
|
+
frameSize: number;
|
|
6
|
+
setPosition: (pos: number) => void;
|
|
7
|
+
animateTo: (pos: number, animationOverride?: any) => void;
|
|
8
|
+
stopSpring: () => void;
|
|
9
|
+
scrollBridge: ScrollBridge;
|
|
10
|
+
setIsDragging: (val: boolean) => void;
|
|
11
|
+
getCurrentPosition: () => number;
|
|
12
|
+
resisted: (val: number, minY: number) => number;
|
|
13
|
+
disableDrag?: boolean;
|
|
14
|
+
isShowingInnerSheet?: boolean;
|
|
15
|
+
setAnimatedPosition: (val: number) => void;
|
|
16
|
+
scrollGestureRef?: RefObject<any> | null;
|
|
17
|
+
pauseKeyboardHandler?: RefObject<boolean>;
|
|
18
|
+
}
|
|
19
|
+
interface GesturePanResult {
|
|
20
|
+
panGesture: any | null;
|
|
21
|
+
panGestureRef: RefObject<any>;
|
|
22
|
+
gestureHandlerEnabled: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Hook that creates a Gesture.Pan() handler for use with react-native-gesture-handler.
|
|
26
|
+
* This provides native-quality gesture coordination between Sheet and ScrollView.
|
|
27
|
+
*
|
|
28
|
+
* Uses state-based decision pattern (like gorhom/bottom-sheet and react-native-actions-sheet):
|
|
29
|
+
* - Both pan and scroll gestures run simultaneously
|
|
30
|
+
* - In onChange, we decide whether to process pan or let scroll handle it
|
|
31
|
+
* - scrollBridge.setScrollEnabled toggles scroll on/off as needed
|
|
32
|
+
*
|
|
33
|
+
* Decision matrix:
|
|
34
|
+
* 1. Sheet not fully open + swiping up -> pan handles (disable scroll)
|
|
35
|
+
* 2. Sheet fully open + swiping up -> scroll handles (blockPan)
|
|
36
|
+
* 3. Sheet not fully open + swiping down -> pan handles (unless scrolled)
|
|
37
|
+
* 4. Sheet fully open + swiping down + scrollY=0 -> pan handles
|
|
38
|
+
* 5. Sheet fully open + swiping down + scrollY>0 -> scroll handles (blockPan)
|
|
39
|
+
*
|
|
40
|
+
* Returns null for the gesture if RNGH is not available or drag is disabled.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useGestureHandlerPan(config: GesturePanConfig): GesturePanResult;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=useGestureHandlerPan.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web stub for keyboard controller sheet hook.
|
|
3
|
+
* Returns no-op values since keyboard-controller is native-only.
|
|
4
|
+
*/
|
|
5
|
+
import type { KeyboardControllerSheetOptions, KeyboardControllerSheetResult } from './types';
|
|
6
|
+
export declare function useKeyboardControllerSheet(_options: KeyboardControllerSheetOptions): KeyboardControllerSheetResult;
|
|
7
|
+
//# sourceMappingURL=useKeyboardControllerSheet.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native implementation of keyboard controller sheet hook.
|
|
3
|
+
*
|
|
4
|
+
* Simplified to just track keyboard state (height, visibility).
|
|
5
|
+
* Position animation is handled by SheetImplementationCustom via
|
|
6
|
+
* keyboard-adjusted positions — matching the react-native-actions-sheet pattern.
|
|
7
|
+
*
|
|
8
|
+
* Uses react-native-keyboard-controller events when available,
|
|
9
|
+
* falls back to basic Keyboard API otherwise.
|
|
10
|
+
*/
|
|
11
|
+
import type { KeyboardControllerSheetOptions, KeyboardControllerSheetResult } from './types';
|
|
12
|
+
export declare function useKeyboardControllerSheet(options: KeyboardControllerSheetOptions): KeyboardControllerSheetResult;
|
|
13
|
+
//# sourceMappingURL=useKeyboardControllerSheet.native.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const useSheetController: () => {
|
|
3
|
+
controller: SheetControllerContextValue | null;
|
|
4
|
+
isHidden: boolean | undefined;
|
|
5
|
+
isShowingNonSheet: boolean | undefined;
|
|
6
|
+
disableDrag: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const SheetControllerContext: React.Context<SheetControllerContextValue | null>;
|
|
9
|
+
export type SheetControllerContextValue = {
|
|
10
|
+
id?: string;
|
|
11
|
+
disableDrag?: boolean;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
onOpenChange?: React.Dispatch<React.SetStateAction<boolean>> | ((val: boolean) => void);
|
|
15
|
+
skipNextAnimation?: boolean;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useSheetController.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SheetProps } from './types';
|
|
2
|
+
export declare const useSheetOpenState: (props: SheetProps) => {
|
|
3
|
+
open: boolean;
|
|
4
|
+
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
|
+
isHidden: boolean | undefined;
|
|
6
|
+
controller: import("./useSheetController").SheetControllerContextValue | null;
|
|
7
|
+
};
|
|
8
|
+
export type SheetOpenState = ReturnType<typeof useSheetOpenState>;
|
|
9
|
+
//# sourceMappingURL=useSheetOpenState.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { GuiElement } from '@gui/core';
|
|
3
|
+
import type { ScrollBridge, SheetProps } from './types';
|
|
4
|
+
import type { SheetOpenState } from './useSheetOpenState';
|
|
5
|
+
export type SheetContextValue = ReturnType<typeof useSheetProviderProps> & {
|
|
6
|
+
setHasScrollView: (val: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function useSheetProviderProps(props: SheetProps, state: SheetOpenState, options?: {
|
|
9
|
+
onOverlayComponent?: (comp: any) => void;
|
|
10
|
+
}): {
|
|
11
|
+
screenSize: number;
|
|
12
|
+
maxSnapPoint: string | number;
|
|
13
|
+
disableRemoveScroll: boolean;
|
|
14
|
+
scrollBridge: ScrollBridge;
|
|
15
|
+
modal: boolean;
|
|
16
|
+
open: boolean;
|
|
17
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
18
|
+
hidden: boolean;
|
|
19
|
+
contentRef: React.RefObject<GuiElement | null>;
|
|
20
|
+
handleRef: React.RefObject<GuiElement | null>;
|
|
21
|
+
frameSize: number;
|
|
22
|
+
setFrameSize: React.Dispatch<React.SetStateAction<number>>;
|
|
23
|
+
dismissOnOverlayPress: boolean;
|
|
24
|
+
dismissOnSnapToBottom: boolean;
|
|
25
|
+
onOverlayComponent: ((comp: any) => void) | undefined;
|
|
26
|
+
scope: import("@gui/create-context").Scope<any>;
|
|
27
|
+
hasFit: boolean;
|
|
28
|
+
position: number;
|
|
29
|
+
snapPoints: (string | number)[];
|
|
30
|
+
snapPointsMode: import("./types").SnapPointsMode;
|
|
31
|
+
setMaxContentSize: React.Dispatch<React.SetStateAction<number>>;
|
|
32
|
+
setPosition: (next: number) => void;
|
|
33
|
+
setPositionImmediate: React.Dispatch<React.SetStateAction<number>>;
|
|
34
|
+
onlyShowFrame: boolean;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=useSheetProviderProps.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ScrollView as RNScrollView } from 'react-native';
|
|
2
|
+
import type { ScrollBridge } from './types';
|
|
3
|
+
interface UseSheetScrollViewGesturesProps {
|
|
4
|
+
scrollRef: React.RefObject<RNScrollView | null>;
|
|
5
|
+
scrollBridge: ScrollBridge;
|
|
6
|
+
hasScrollableContent: boolean;
|
|
7
|
+
scrollEnabled: boolean;
|
|
8
|
+
setScrollEnabled: (enabled: boolean, lockTo?: number) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useSheetScrollViewGestures({ scrollRef, scrollBridge, hasScrollableContent, }: UseSheetScrollViewGesturesProps): {};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useSheetScrollViewGestures.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GestureResponderEvent, ScrollView as RNScrollView } from 'react-native';
|
|
2
|
+
import type { ScrollBridge } from './types';
|
|
3
|
+
interface UseSheetScrollViewGesturesProps {
|
|
4
|
+
scrollRef: React.RefObject<RNScrollView | null>;
|
|
5
|
+
scrollBridge: ScrollBridge;
|
|
6
|
+
hasScrollableContent: boolean;
|
|
7
|
+
scrollEnabled: boolean;
|
|
8
|
+
setScrollEnabled: (enabled: boolean, lockTo?: number) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Native gesture handling for Sheet ScrollView.
|
|
12
|
+
* Returns responder props for the ScrollView component.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useSheetScrollViewGestures({ scrollBridge, hasScrollableContent, scrollEnabled, setScrollEnabled, }: UseSheetScrollViewGesturesProps): {
|
|
15
|
+
onResponderRelease: () => void;
|
|
16
|
+
onStartShouldSetResponder: () => boolean;
|
|
17
|
+
onMoveShouldSetResponder: (e: GestureResponderEvent) => boolean;
|
|
18
|
+
onResponderMove: (e: GestureResponderEvent) => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useSheetScrollViewGestures.native.d.ts.map
|