@hero-design/rn 8.128.3 → 8.129.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.
@@ -0,0 +1,18 @@
1
+ import type { ScrollViewProps } from 'react-native';
2
+ import type { ReactElement } from 'react';
3
+ export type DragableScrollViewProps = ScrollViewProps;
4
+ /**
5
+ * A ScrollView that coordinates with a parent DragableDrawer.
6
+ *
7
+ * - Drawer below max height: all gestures move the drawer; scroll is locked.
8
+ * - Drawer at max height: native scrolling works normally.
9
+ * - Drawer at max + scrolled to top + pull down: drawer collapses.
10
+ *
11
+ * The native ScrollView with bounces={false}/overScrollMode="never" will not
12
+ * intercept a downward gesture at scrollY=0 (nothing left to scroll), so
13
+ * onMoveShouldSetPanResponderCapture fires cleanly on both platforms.
14
+ * onScrollEndDrag + onMomentumScrollEnd ensure scrollYRef is up-to-date
15
+ * before the next gesture starts.
16
+ */
17
+ declare const DragableScrollView: ({ onScroll, onScrollEndDrag: onScrollEndDragProp, onMomentumScrollEnd: onMomentumScrollEndProp, scrollEventThrottle, children, ...props }: DragableScrollViewProps) => ReactElement;
18
+ export default DragableScrollView;
@@ -0,0 +1,23 @@
1
+ import type { MutableRefObject } from 'react';
2
+ import { Animated } from 'react-native';
3
+ import type { GestureResponderHandlers } from 'react-native';
4
+ interface UseDragablePanOptions {
5
+ height: number;
6
+ initialHeightPercentage: number | undefined;
7
+ minimumHeightPercentage: number;
8
+ snapPoints: number[];
9
+ onExpanded?: () => void;
10
+ onCollapsed?: () => void;
11
+ }
12
+ interface UseDragablePanResult {
13
+ pan: Animated.Value;
14
+ isAtMaxHeight: boolean;
15
+ scrollYRef: MutableRefObject<number>;
16
+ onScrollY: (y: number) => void;
17
+ beginPan: () => void;
18
+ movePan: (dy: number) => void;
19
+ releasePan: (dy: number, vy: number) => void;
20
+ panHandlers: GestureResponderHandlers;
21
+ }
22
+ declare const useDragablePan: ({ height, initialHeightPercentage, minimumHeightPercentage, snapPoints, onExpanded, onCollapsed, }: UseDragablePanOptions) => UseDragablePanResult;
23
+ export default useDragablePan;
@@ -23,5 +23,6 @@ interface DrawerProps {
23
23
  }
24
24
  declare const _default: (({ visible, children, hasBackdrop, onDismiss, testID, }: DrawerProps) => ReactElement) & {
25
25
  Dragable: ({ children, initialHeightPercentage, minimumHeightPercentage, snapPoints, onExpanded, onCollapsed, testID, }: import("./DragableDrawer").DragableDrawerProps) => ReactElement;
26
+ DragableScrollView: ({ onScroll, onScrollEndDrag: onScrollEndDragProp, onMomentumScrollEnd: onMomentumScrollEndProp, scrollEventThrottle, children, ...props }: import("./DragableDrawer/DragableScrollView").DragableScrollViewProps) => ReactElement;
26
27
  };
27
28
  export default _default;