react-native-header-motion 1.0.0-alpha.0 → 1.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.
Files changed (137) hide show
  1. package/README.md +65 -528
  2. package/lib/module/components/Bridge.js +16 -0
  3. package/lib/module/components/Bridge.js.map +1 -0
  4. package/lib/module/components/FlatList.js +5 -54
  5. package/lib/module/components/FlatList.js.map +1 -1
  6. package/lib/module/components/Header.js +71 -13
  7. package/lib/module/components/Header.js.map +1 -1
  8. package/lib/module/components/HeaderDynamic.js +34 -0
  9. package/lib/module/components/HeaderDynamic.js.map +1 -0
  10. package/lib/module/components/HeaderMotion.js +14 -20
  11. package/lib/module/components/HeaderMotion.js.map +1 -1
  12. package/lib/module/components/HeaderPanBoundary.js +54 -0
  13. package/lib/module/components/HeaderPanBoundary.js.map +1 -0
  14. package/lib/module/components/NavigationBridge.js +20 -0
  15. package/lib/module/components/NavigationBridge.js.map +1 -0
  16. package/lib/module/components/ScrollManager.js +19 -7
  17. package/lib/module/components/ScrollManager.js.map +1 -1
  18. package/lib/module/components/ScrollView.js +6 -39
  19. package/lib/module/components/ScrollView.js.map +1 -1
  20. package/lib/module/components/createHeaderMotionScrollable.js +136 -0
  21. package/lib/module/components/createHeaderMotionScrollable.js.map +1 -0
  22. package/lib/module/components/index.js +3 -1
  23. package/lib/module/components/index.js.map +1 -1
  24. package/lib/module/context.js +8 -1
  25. package/lib/module/context.js.map +1 -1
  26. package/lib/module/hooks/index.js +1 -0
  27. package/lib/module/hooks/index.js.map +1 -1
  28. package/lib/module/hooks/useActiveScrollId.js +7 -6
  29. package/lib/module/hooks/useActiveScrollId.js.map +1 -1
  30. package/lib/module/hooks/useConsumerScrollHandlers.js +86 -0
  31. package/lib/module/hooks/useConsumerScrollHandlers.js.map +1 -0
  32. package/lib/module/hooks/useHeaderMotionBridge.js +14 -0
  33. package/lib/module/hooks/useHeaderMotionBridge.js.map +1 -0
  34. package/lib/module/hooks/useMotionProgress.js +12 -42
  35. package/lib/module/hooks/useMotionProgress.js.map +1 -1
  36. package/lib/module/hooks/useMotionProgress.test.js +56 -0
  37. package/lib/module/hooks/useMotionProgress.test.js.map +1 -0
  38. package/lib/module/hooks/useScrollManager.js +168 -87
  39. package/lib/module/hooks/useScrollManager.js.map +1 -1
  40. package/lib/module/index.js +21 -18
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/module/utils/defaults.js +2 -1
  43. package/lib/module/utils/defaults.js.map +1 -1
  44. package/lib/module/utils/header.js +24 -0
  45. package/lib/module/utils/header.js.map +1 -0
  46. package/lib/module/utils/headerOffsetStyle.js +31 -0
  47. package/lib/module/utils/headerOffsetStyle.js.map +1 -0
  48. package/lib/module/utils/index.js +2 -0
  49. package/lib/module/utils/index.js.map +1 -1
  50. package/lib/typescript/docs/docusaurus.config.d.ts +4 -0
  51. package/lib/typescript/docs/docusaurus.config.d.ts.map +1 -0
  52. package/lib/typescript/docs/sidebars.d.ts +4 -0
  53. package/lib/typescript/docs/sidebars.d.ts.map +1 -0
  54. package/lib/typescript/docs/src/pages/index.d.ts +2 -0
  55. package/lib/typescript/docs/src/pages/index.d.ts.map +1 -0
  56. package/lib/typescript/src/components/Bridge.d.ts +19 -0
  57. package/lib/typescript/src/components/Bridge.d.ts.map +1 -0
  58. package/lib/typescript/src/components/FlatList.d.ts +7 -15
  59. package/lib/typescript/src/components/FlatList.d.ts.map +1 -1
  60. package/lib/typescript/src/components/Header.d.ts +73 -12
  61. package/lib/typescript/src/components/Header.d.ts.map +1 -1
  62. package/lib/typescript/src/components/HeaderDynamic.d.ts +11 -0
  63. package/lib/typescript/src/components/HeaderDynamic.d.ts.map +1 -0
  64. package/lib/typescript/src/components/HeaderMotion.d.ts +38 -23
  65. package/lib/typescript/src/components/HeaderMotion.d.ts.map +1 -1
  66. package/lib/typescript/src/components/HeaderPanBoundary.d.ts +11 -0
  67. package/lib/typescript/src/components/HeaderPanBoundary.d.ts.map +1 -0
  68. package/lib/typescript/src/components/NavigationBridge.d.ts +19 -0
  69. package/lib/typescript/src/components/NavigationBridge.d.ts.map +1 -0
  70. package/lib/typescript/src/components/ScrollManager.d.ts +13 -9
  71. package/lib/typescript/src/components/ScrollManager.d.ts.map +1 -1
  72. package/lib/typescript/src/components/ScrollView.d.ts +7 -14
  73. package/lib/typescript/src/components/ScrollView.d.ts.map +1 -1
  74. package/lib/typescript/src/components/createHeaderMotionScrollable.d.ts +86 -0
  75. package/lib/typescript/src/components/createHeaderMotionScrollable.d.ts.map +1 -0
  76. package/lib/typescript/src/components/index.d.ts +3 -1
  77. package/lib/typescript/src/components/index.d.ts.map +1 -1
  78. package/lib/typescript/src/context.d.ts +3 -17
  79. package/lib/typescript/src/context.d.ts.map +1 -1
  80. package/lib/typescript/src/hooks/index.d.ts +1 -0
  81. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  82. package/lib/typescript/src/hooks/useActiveScrollId.d.ts +7 -6
  83. package/lib/typescript/src/hooks/useActiveScrollId.d.ts.map +1 -1
  84. package/lib/typescript/src/hooks/useConsumerScrollHandlers.d.ts +64 -0
  85. package/lib/typescript/src/hooks/useConsumerScrollHandlers.d.ts.map +1 -0
  86. package/lib/typescript/src/hooks/useHeaderMotionBridge.d.ts +10 -0
  87. package/lib/typescript/src/hooks/useHeaderMotionBridge.d.ts.map +1 -0
  88. package/lib/typescript/src/hooks/useMotionProgress.d.ts +8 -25
  89. package/lib/typescript/src/hooks/useMotionProgress.d.ts.map +1 -1
  90. package/lib/typescript/src/hooks/useMotionProgress.test.d.ts +2 -0
  91. package/lib/typescript/src/hooks/useMotionProgress.test.d.ts.map +1 -0
  92. package/lib/typescript/src/hooks/useScrollManager.d.ts +61 -29
  93. package/lib/typescript/src/hooks/useScrollManager.d.ts.map +1 -1
  94. package/lib/typescript/src/index.d.ts +56 -26
  95. package/lib/typescript/src/index.d.ts.map +1 -1
  96. package/lib/typescript/src/types.d.ts +54 -17
  97. package/lib/typescript/src/types.d.ts.map +1 -1
  98. package/lib/typescript/src/utils/defaults.d.ts +3 -2
  99. package/lib/typescript/src/utils/defaults.d.ts.map +1 -1
  100. package/lib/typescript/src/utils/header.d.ts +10 -0
  101. package/lib/typescript/src/utils/header.d.ts.map +1 -0
  102. package/lib/typescript/src/utils/headerOffsetStyle.d.ts +19 -0
  103. package/lib/typescript/src/utils/headerOffsetStyle.d.ts.map +1 -0
  104. package/lib/typescript/src/utils/index.d.ts +2 -0
  105. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  106. package/lib/typescript/src/utils/refreshControl.d.ts +12 -12
  107. package/package.json +12 -5
  108. package/src/components/Bridge.tsx +29 -0
  109. package/src/components/FlatList.tsx +18 -76
  110. package/src/components/Header.tsx +159 -23
  111. package/src/components/HeaderDynamic.tsx +45 -0
  112. package/src/components/HeaderMotion.tsx +47 -50
  113. package/src/components/HeaderPanBoundary.tsx +92 -0
  114. package/src/components/NavigationBridge.tsx +30 -0
  115. package/src/components/ScrollManager.tsx +23 -11
  116. package/src/components/ScrollView.tsx +16 -60
  117. package/src/components/createHeaderMotionScrollable.tsx +438 -0
  118. package/src/components/index.ts +3 -1
  119. package/src/context.ts +11 -24
  120. package/src/hooks/index.ts +1 -0
  121. package/src/hooks/useActiveScrollId.ts +7 -6
  122. package/src/hooks/useConsumerScrollHandlers.ts +148 -0
  123. package/src/hooks/useHeaderMotionBridge.ts +15 -0
  124. package/src/hooks/useMotionProgress.test.ts +67 -0
  125. package/src/hooks/useMotionProgress.ts +12 -45
  126. package/src/hooks/useScrollManager.ts +251 -114
  127. package/src/index.ts +82 -36
  128. package/src/types.ts +81 -29
  129. package/src/utils/defaults.ts +7 -1
  130. package/src/utils/header.tsx +52 -0
  131. package/src/utils/headerOffsetStyle.ts +40 -0
  132. package/src/utils/index.ts +2 -0
  133. package/lib/module/components/HeaderBase.js +0 -107
  134. package/lib/module/components/HeaderBase.js.map +0 -1
  135. package/lib/typescript/src/components/HeaderBase.d.ts +0 -41
  136. package/lib/typescript/src/components/HeaderBase.d.ts.map +0 -1
  137. package/src/components/HeaderBase.tsx +0 -140
@@ -7,7 +7,7 @@ declare const AnimatedRefreshControl: import("react-native-reanimated/lib/typesc
7
7
  onLayout?: ((event: import("react-native").LayoutChangeEvent) => unknown) | undefined;
8
8
  onMagicTap?: (() => unknown) | undefined;
9
9
  onAccessibilityEscape?: (() => unknown) | undefined;
10
- }>, "style" | "onMoveShouldSetResponder" | "onMoveShouldSetResponderCapture" | "onResponderGrant" | "onResponderMove" | "onResponderReject" | "onResponderRelease" | "onResponderStart" | "onResponderEnd" | "onResponderTerminate" | "onResponderTerminationRequest" | "onStartShouldSetResponder" | "onStartShouldSetResponderCapture" | "onMouseEnter" | "onMouseLeave" | "onClick" | "onClickCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onBlur" | "onBlurCapture" | "onFocus" | "onFocusCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
10
+ }>, "id" | "style" | "children" | "tabIndex" | "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-labelledby" | "aria-live" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onClick" | "onClickCapture" | "onMouseEnter" | "onMouseLeave" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onMoveShouldSetResponder" | "onMoveShouldSetResponderCapture" | "onResponderGrant" | "onResponderMove" | "onResponderReject" | "onResponderRelease" | "onResponderStart" | "onResponderEnd" | "onResponderTerminate" | "onResponderTerminationRequest" | "onStartShouldSetResponder" | "onStartShouldSetResponderCapture" | "onPointerEnterCapture" | "onPointerLeaveCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "screenReaderFocusable" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
11
11
  onMoveShouldSetResponder?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
12
12
  onMoveShouldSetResponderCapture?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
13
13
  onResponderGrant?: ((e: import("react-native").GestureResponderEvent) => void | boolean) | undefined;
@@ -20,10 +20,10 @@ declare const AnimatedRefreshControl: import("react-native-reanimated/lib/typesc
20
20
  onResponderTerminationRequest?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
21
21
  onStartShouldSetResponder?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
22
22
  onStartShouldSetResponderCapture?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
23
- }>, "style" | "onMouseEnter" | "onMouseLeave" | "onClick" | "onClickCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onBlur" | "onBlurCapture" | "onFocus" | "onFocusCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
23
+ }>, "id" | "style" | "children" | "tabIndex" | "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-labelledby" | "aria-live" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onClick" | "onClickCapture" | "onMouseEnter" | "onMouseLeave" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onPointerEnterCapture" | "onPointerLeaveCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "screenReaderFocusable" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
24
24
  onMouseEnter?: ((event: import("react-native").MouseEvent) => void) | undefined;
25
25
  onMouseLeave?: ((event: import("react-native").MouseEvent) => void) | undefined;
26
- }>, "style" | "onClick" | "onClickCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onBlur" | "onBlurCapture" | "onFocus" | "onFocusCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
26
+ }>, "id" | "style" | "children" | "tabIndex" | "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-labelledby" | "aria-live" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onClick" | "onClickCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onPointerEnterCapture" | "onPointerLeaveCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "screenReaderFocusable" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
27
27
  onClick?: ((event: import("react-native").PointerEvent) => void) | undefined;
28
28
  onClickCapture?: ((event: import("react-native").PointerEvent) => void) | undefined;
29
29
  onPointerEnter?: ((event: import("react-native").PointerEvent) => void) | undefined;
@@ -46,12 +46,12 @@ declare const AnimatedRefreshControl: import("react-native-reanimated/lib/typesc
46
46
  onGotPointerCaptureCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
47
47
  onLostPointerCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
48
48
  onLostPointerCaptureCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
49
- }>, "style" | "onClick" | "onBlur" | "onBlurCapture" | "onFocus" | "onFocusCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
49
+ }>, "id" | "style" | "children" | "tabIndex" | "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-labelledby" | "aria-live" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onClick" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "screenReaderFocusable" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
50
50
  onBlur?: ((event: import("react-native").BlurEvent) => void) | undefined;
51
51
  onBlurCapture?: ((event: import("react-native").BlurEvent) => void) | undefined;
52
52
  onFocus?: ((event: import("react-native").FocusEvent) => void) | undefined;
53
53
  onFocusCapture?: ((event: import("react-native").FocusEvent) => void) | undefined;
54
- }>, "style" | "onClick" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
54
+ }>, "id" | "style" | "children" | "tabIndex" | "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-labelledby" | "aria-live" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onClick" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "screenReaderFocusable" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
55
55
  onTouchCancel?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
56
56
  onTouchCancelCapture?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
57
57
  onTouchEnd?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
@@ -60,7 +60,7 @@ declare const AnimatedRefreshControl: import("react-native-reanimated/lib/typesc
60
60
  onTouchMoveCapture?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
61
61
  onTouchStart?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
62
62
  onTouchStartCapture?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
63
- }>, "style" | "onClick" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
63
+ }>, "id" | "style" | "children" | "tabIndex" | "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-labelledby" | "aria-live" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onClick" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "screenReaderFocusable" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
64
64
  nativeBackgroundAndroid?: import("react-native/types_generated/Libraries/Components/View/ViewPropTypes").AndroidDrawable | undefined;
65
65
  nativeForegroundAndroid?: import("react-native/types_generated/Libraries/Components/View/ViewPropTypes").AndroidDrawable | undefined;
66
66
  renderToHardwareTextureAndroid?: boolean | undefined;
@@ -73,16 +73,16 @@ declare const AnimatedRefreshControl: import("react-native-reanimated/lib/typesc
73
73
  focusable?: boolean | undefined;
74
74
  tabIndex?: 0 | -1;
75
75
  onClick?: ((event: import("react-native").GestureResponderEvent) => unknown) | undefined;
76
- }>, "style" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
76
+ }>, "id" | "style" | "children" | "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-labelledby" | "aria-live" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "screenReaderFocusable" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
77
77
  shouldRasterizeIOS?: boolean | undefined;
78
- }>, "style" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<Omit<Readonly<{
78
+ }>, "id" | "style" | "children" | "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-labelledby" | "aria-live" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "screenReaderFocusable" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<Omit<Readonly<{
79
79
  accessibilityLabelledBy?: (string | undefined) | (Array<string> | undefined);
80
80
  "aria-labelledby"?: string | undefined;
81
81
  accessibilityLiveRegion?: ("none" | "polite" | "assertive") | undefined;
82
82
  "aria-live"?: ("polite" | "assertive" | "off") | undefined;
83
83
  importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined;
84
84
  screenReaderFocusable?: boolean;
85
- }>, "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden"> & Omit<Readonly<{
85
+ }>, "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-modal" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions"> & Omit<Readonly<{
86
86
  accessibilityIgnoresInvertColors?: boolean | undefined;
87
87
  accessibilityViewIsModal?: boolean | undefined;
88
88
  accessibilityShowsLargeContentViewer?: boolean | undefined;
@@ -91,7 +91,7 @@ declare const AnimatedRefreshControl: import("react-native-reanimated/lib/typesc
91
91
  accessibilityElementsHidden?: boolean | undefined;
92
92
  accessibilityLanguage?: string | undefined;
93
93
  accessibilityRespondsToUserInteraction?: boolean | undefined;
94
- }>, "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden"> & {
94
+ }>, "role" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-hidden" | "aria-label" | "aria-selected" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "accessibilityValue" | "accessibilityActions"> & {
95
95
  accessible?: boolean | undefined;
96
96
  accessibilityLabel?: string | undefined;
97
97
  accessibilityHint?: string | undefined;
@@ -111,8 +111,8 @@ declare const AnimatedRefreshControl: import("react-native-reanimated/lib/typesc
111
111
  "aria-expanded"?: boolean | undefined;
112
112
  "aria-selected"?: boolean | undefined;
113
113
  "aria-hidden"?: boolean | undefined;
114
- }>, "style" | "children" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
115
- children?: React.ReactNode;
114
+ }>, "id" | "style" | "children" | "collapsable" | "collapsableChildren" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
115
+ children?: import("react").ReactNode;
116
116
  style?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheet").ViewStyleProp | undefined;
117
117
  collapsable?: boolean | undefined;
118
118
  collapsableChildren?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-header-motion",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.0",
4
4
  "description": "Smooth, animated collapsible headers with scroll-based motion control in React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "typecheck": "tsc",
39
39
  "test": "jest",
40
40
  "release": "release-it --only-version",
41
- "lint": "eslint \"**/*.{js,ts,tsx}\""
41
+ "lint": "eslint src example docs/src docs/*.ts *.js"
42
42
  },
43
43
  "keywords": [
44
44
  "react-native",
@@ -54,7 +54,7 @@
54
54
  "bugs": {
55
55
  "url": "https://github.com/pawicao/react-native-header-motion/issues"
56
56
  },
57
- "homepage": "https://github.com/pawicao/react-native-header-motion#readme",
57
+ "homepage": "https://pawicao.github.io/react-native-header-motion/",
58
58
  "publishConfig": {
59
59
  "registry": "https://registry.npmjs.org/"
60
60
  },
@@ -89,11 +89,12 @@
89
89
  "react": "*",
90
90
  "react-native": "*",
91
91
  "react-native-gesture-handler": "^2.0.0",
92
- "react-native-reanimated": ">=4.0.0",
92
+ "react-native-reanimated": "^4.0.0",
93
93
  "react-native-worklets": ">=0.4.0"
94
94
  },
95
95
  "workspaces": [
96
- "example"
96
+ "example",
97
+ "docs"
97
98
  ],
98
99
  "packageManager": "yarn@4.11.0",
99
100
  "react-native-builder-bob": {
@@ -116,6 +117,12 @@
116
117
  },
117
118
  "jest": {
118
119
  "preset": "react-native",
120
+ "setupFilesAfterEnv": [
121
+ "<rootDir>/jest-setup.js"
122
+ ],
123
+ "transformIgnorePatterns": [
124
+ "node_modules/(?!(react-native|@react-native|react-native-reanimated|react-native-worklets)/)"
125
+ ],
119
126
  "modulePathIgnorePatterns": [
120
127
  "<rootDir>/example/node_modules",
121
128
  "<rootDir>/lib/"
@@ -0,0 +1,29 @@
1
+ import { useHeaderMotionBridge } from '../hooks/useHeaderMotionBridge';
2
+ import type { ReactNode } from 'react';
3
+ import type { HeaderMotionBridgeValue } from '../types';
4
+
5
+ type HeaderRenderChildren = (value: HeaderMotionBridgeValue) => ReactNode;
6
+
7
+ export interface HeaderMotionBridgeProps {
8
+ /**
9
+ * Render function that receives the current HeaderMotion context value.
10
+ *
11
+ * Use this when you need to pass the library's context across a React tree
12
+ * boundary, most commonly into a navigation-rendered header.
13
+ */
14
+ children: HeaderRenderChildren;
15
+ }
16
+
17
+ /**
18
+ * Reads the current HeaderMotion context and exposes it through a render
19
+ * function so it can be forwarded into another subtree.
20
+ */
21
+ export function Bridge({ children }: HeaderMotionBridgeProps) {
22
+ if (typeof children !== 'function') {
23
+ throw new Error(
24
+ 'HeaderMotion.Bridge only accepts a render function as its child.'
25
+ );
26
+ }
27
+
28
+ return children(useHeaderMotionBridge());
29
+ }
@@ -1,23 +1,18 @@
1
- import { forwardRef, type ComponentProps, type ComponentRef } from 'react';
2
- import Animated, { type AnimatedRef } from 'react-native-reanimated';
3
- import { HeaderMotionScrollManager } from './ScrollManager';
1
+ import type { ReactElement } from 'react';
2
+ import Animated, {
3
+ type FlatListPropsWithLayout,
4
+ } from 'react-native-reanimated';
5
+ import {
6
+ createHeaderMotionScrollable,
7
+ type HeaderMotionScrollableOwnProps,
8
+ } from './createHeaderMotionScrollable';
4
9
 
5
- import type { ScrollViewProps } from 'react-native';
10
+ export type HeaderMotionFlatListProps<T = any> = FlatListPropsWithLayout<T> &
11
+ HeaderMotionScrollableOwnProps<Animated.FlatList<T>>;
6
12
 
7
- export type HeaderMotionFlatListProps<T = any> = ComponentProps<
8
- typeof Animated.FlatList<T>
9
- > & {
10
- /**
11
- * Optional unique identifier for this scroll view.
12
- * Use this when you have multiple scroll views (e.g. in tabs) to track them separately.
13
- */
14
- scrollId?: string;
15
- /**
16
- * Optional animated ref to use for the flat list.
17
- * When provided, the scroll manager will use this ref instead of creating its own.
18
- */
19
- animatedRef?: AnimatedRef<Animated.FlatList<T>> | AnimatedRef;
20
- };
13
+ type FlatListComponent = <T = any>(
14
+ props: HeaderMotionFlatListProps<T>
15
+ ) => ReactElement | null;
21
16
 
22
17
  /**
23
18
  * Animated FlatList component that integrates with HeaderMotion.
@@ -36,61 +31,8 @@ export type HeaderMotionFlatListProps<T = any> = ComponentProps<
36
31
  * </HeaderMotion>
37
32
  * ```
38
33
  */
39
- export function HeaderMotionFlatList<T = any>({
40
- scrollId,
41
- animatedRef,
42
- contentContainerStyle,
43
- ...props
44
- }: HeaderMotionFlatListProps<T>) {
45
- return (
46
- <HeaderMotionScrollManager
47
- scrollId={scrollId}
48
- animatedRef={animatedRef as AnimatedRef<Animated.FlatList<T>>}
49
- refreshControl={props.refreshControl}
50
- refreshing={props.refreshing}
51
- onRefresh={props.onRefresh}
52
- progressViewOffset={props.progressViewOffset}
53
- >
54
- {(
55
- {
56
- onScroll,
57
- refreshControl: managedRefreshControl,
58
- ref,
59
- ...scrollViewProps
60
- },
61
- { originalHeaderHeight, minHeightContentContainerStyle }
62
- ) => (
63
- <Animated.FlatList
64
- {...scrollViewProps}
65
- {...props}
66
- ref={ref}
67
- onScroll={onScroll}
68
- {...(managedRefreshControl && {
69
- refreshControl: managedRefreshControl,
70
- })}
71
- renderScrollComponent={(scrollComponentProps) => (
72
- <AnimatedScrollContainer
73
- {...scrollComponentProps}
74
- contentContainerStyle={[
75
- minHeightContentContainerStyle,
76
- { paddingTop: originalHeaderHeight },
77
- contentContainerStyle,
78
- ]}
79
- />
80
- )}
81
- />
82
- )}
83
- </HeaderMotionScrollManager>
84
- );
85
- }
86
-
87
- const AnimatedScrollContainer = forwardRef<
88
- ComponentRef<typeof Animated.ScrollView>,
89
- ScrollViewProps
90
- >(({ children, contentContainerStyle, ...rest }, ref) => {
91
- return (
92
- <Animated.ScrollView {...rest} ref={ref}>
93
- <Animated.View style={contentContainerStyle}>{children}</Animated.View>
94
- </Animated.ScrollView>
95
- );
96
- });
34
+ export const FlatList = createHeaderMotionScrollable(Animated.FlatList, {
35
+ displayName: 'HeaderMotion.FlatList',
36
+ contentContainerMode: 'renderScrollComponent',
37
+ isComponentAnimated: true,
38
+ }) as FlatListComponent;
@@ -1,30 +1,166 @@
1
- import { useMotionProgress } from '../hooks/useMotionProgress';
2
- import type { MotionProgress } from '../types';
3
- import type { ReactNode } from 'react';
1
+ import { StyleSheet, type ViewProps } from 'react-native';
2
+ import Animated from 'react-native-reanimated';
3
+ import { useHeaderMotionContextOrThrow } from '../context';
4
+ import type {
5
+ HeaderAsChildProps,
6
+ HeaderDefaultProps,
7
+ HeaderPanDecayConfig,
8
+ } from '../types';
9
+ import {
10
+ cloneWithOnLayout,
11
+ composeOnLayoutHandlers,
12
+ resolveSlottableChild,
13
+ } from '../utils';
14
+ import { HeaderDynamic } from './HeaderDynamic';
15
+ import { HeaderPanBoundary } from './HeaderPanBoundary';
4
16
 
5
- type HeaderRenderChildren = (props: MotionProgress) => ReactNode;
17
+ type HeaderPanProps =
18
+ | {
19
+ /** Enables dragging the header itself to scroll the active scrollable.
20
+ *
21
+ * This is useful when the header covers a large portion of the screen
22
+ * and you want the gesture to feel continuous between header and content.
23
+ *
24
+ * @default false
25
+ */
26
+ pannable: true;
27
+ /**
28
+ * Customizes the momentum animation that runs after a header pan ends.
29
+ *
30
+ * Use an object for a fixed decay profile. Use a function when the decay
31
+ * should depend on the end event, for example to dampen or amplify
32
+ * certain velocities.
33
+ *
34
+ * If you provide a function, it runs inside the gesture end worklet and
35
+ * **must itself be marked with the 'worklet' directive.**
36
+ */
37
+ panDecayConfig?: HeaderPanDecayConfig;
38
+ }
39
+ | {
40
+ pannable?: false | undefined;
41
+ panDecayConfig?: never;
42
+ };
6
43
 
7
- export interface HeaderMotionHeaderProps {
8
- /**
9
- * Render function that receives motion progress props.
10
- * Use this to animate your header based on scroll progress and to provide measurement functions to the elements of the header.
11
- */
12
- children: HeaderRenderChildren;
13
- }
44
+ export type HeaderProps =
45
+ | (HeaderDefaultProps &
46
+ HeaderPanProps & {
47
+ /**
48
+ * Applies the default absolute-positioned header layout.
49
+ *
50
+ * Leave this enabled for navigation headers and any header that should
51
+ * visually float above the scrollable content. Disable it only when you
52
+ * intentionally want the header to participate in normal layout flow.
53
+ *
54
+ * @default true
55
+ */
56
+ overlay?: boolean;
57
+ /**
58
+ * Wraps the pan gesture in `GestureHandlerRootView`.
59
+ *
60
+ * Only use this when the rendered header subtree is not already under a
61
+ * gesture-handler root.
62
+ *
63
+ * @default false
64
+ */
65
+ withGestureHandlerRootView?: boolean;
66
+ })
67
+ | (HeaderAsChildProps &
68
+ HeaderPanProps & {
69
+ /**
70
+ * Wraps the pan gesture in `GestureHandlerRootView`.
71
+ *
72
+ * Only use this when the rendered header subtree is not already under a
73
+ * gesture-handler root.
74
+ *
75
+ * @default false
76
+ */
77
+ withGestureHandlerRootView?: boolean;
78
+ });
14
79
 
15
- /**
16
- * Header component for providing motion progress properties to animated headers.
17
- * Must be used within a HeaderMotion component.
18
- *
19
- * Use to pass props to the header components in React Navigation / Expo Router, which cannot access HeaderMotion's context and `useMotionProgress` otherwise.`
20
- */
21
- export function HeaderMotionHeader({ children }: HeaderMotionHeaderProps) {
22
- if (typeof children !== 'function') {
23
- throw new Error(
24
- 'HeaderMotion.Header only accepts render function as the only child.'
80
+ const headerOverlayStyle = StyleSheet.create({
81
+ overlay: {
82
+ position: 'absolute',
83
+ top: 0,
84
+ left: 0,
85
+ right: 0,
86
+ },
87
+ }).overlay;
88
+
89
+ function HeaderRoot(props: HeaderProps) {
90
+ const ctxValue = useHeaderMotionContextOrThrow(
91
+ 'HeaderMotion.Header must be used within <HeaderMotion /> or <HeaderMotion.NavigationBridge />. If you are rendering inside a navigation header, bridge the context with <HeaderMotion.Bridge /> and <HeaderMotion.NavigationBridge />.'
92
+ );
93
+
94
+ if (props.asChild) {
95
+ const child = resolveSlottableChild('HeaderMotion.Header', props.children);
96
+
97
+ return (
98
+ <HeaderPanBoundary
99
+ pannable={props.pannable}
100
+ panDecayConfig={props.panDecayConfig}
101
+ headerPanMomentumOffset={ctxValue.headerPanMomentumOffset}
102
+ scrollToRef={ctxValue.scrollToRef}
103
+ withGestureHandlerRootView={props.withGestureHandlerRootView}
104
+ >
105
+ {cloneWithOnLayout(
106
+ child,
107
+ ctxValue.measureTotalHeight,
108
+ 'HeaderMotion.Header'
109
+ )}
110
+ </HeaderPanBoundary>
25
111
  );
26
112
  }
27
113
 
28
- const motionProgressProps = useMotionProgress();
29
- return children(motionProgressProps);
114
+ const {
115
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
116
+ asChild: _asChild,
117
+ overlay = true,
118
+ pannable,
119
+ panDecayConfig,
120
+ onLayout,
121
+ style,
122
+ withGestureHandlerRootView,
123
+ ...rest
124
+ } = props;
125
+ const resolvedOnLayout = onLayout as ViewProps['onLayout'] | undefined;
126
+
127
+ return (
128
+ <HeaderPanBoundary
129
+ pannable={pannable}
130
+ panDecayConfig={panDecayConfig}
131
+ headerPanMomentumOffset={ctxValue.headerPanMomentumOffset}
132
+ scrollToRef={ctxValue.scrollToRef}
133
+ withGestureHandlerRootView={withGestureHandlerRootView}
134
+ >
135
+ <Animated.View
136
+ {...rest}
137
+ onLayout={composeOnLayoutHandlers(
138
+ resolvedOnLayout,
139
+ ctxValue.measureTotalHeight
140
+ )}
141
+ style={[overlay ? headerOverlayStyle : undefined, style]}
142
+ />
143
+ </HeaderPanBoundary>
144
+ );
30
145
  }
146
+
147
+ /**
148
+ * Header container that measures the total header height for scroll offsetting.
149
+ *
150
+ * It renders an `Animated.View` by default, wires the outer header measurement
151
+ * automatically, and can optionally make the header surface pannable.
152
+ *
153
+ * Pair it with `Header.Dynamic` to mark the part of the header that should
154
+ * drive the collapse threshold.
155
+ */
156
+ export const Header = Object.assign(HeaderRoot, {
157
+ /**
158
+ * Marks the part of the header whose measured layout should define the
159
+ * collapsible distance.
160
+ *
161
+ * In most designs, this is the section that visually disappears while the
162
+ * header collapses. Its measured value feeds `measureDynamic`, which can in
163
+ * turn drive `progressThreshold`.
164
+ */
165
+ Dynamic: HeaderDynamic,
166
+ });
@@ -0,0 +1,45 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import Animated from 'react-native-reanimated';
3
+ import { useHeaderMotionContextOrThrow } from '../context';
4
+ import type { HeaderDynamicProps } from '../types';
5
+ import {
6
+ cloneWithOnLayout,
7
+ composeOnLayoutHandlers,
8
+ resolveSlottableChild,
9
+ } from '../utils';
10
+
11
+ /**
12
+ * Marks the part of the header whose layout should define the collapsible
13
+ * distance.
14
+ *
15
+ * In most designs, this is the section that visually disappears while the
16
+ * header collapses. Its measured value feeds `measureDynamic`, which in turn
17
+ * can drive `progressThreshold`.
18
+ */
19
+ export function HeaderDynamic(props: HeaderDynamicProps) {
20
+ const ctxValue = useHeaderMotionContextOrThrow(
21
+ 'HeaderMotion.Header.Dynamic must be used within <HeaderMotion /> or <HeaderMotion.NavigationBridge />. If you are rendering inside a navigation header, bridge the context with <HeaderMotion.Bridge /> and <HeaderMotion.NavigationBridge />.'
22
+ );
23
+
24
+ if (props.asChild) {
25
+ return cloneWithOnLayout(
26
+ resolveSlottableChild('HeaderMotion.Header.Dynamic', props.children),
27
+ ctxValue.measureDynamic,
28
+ 'HeaderMotion.Header.Dynamic'
29
+ );
30
+ }
31
+
32
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
+ const { asChild: _asChild, onLayout, ...rest } = props;
34
+ const resolvedOnLayout = onLayout as ViewProps['onLayout'] | undefined;
35
+
36
+ return (
37
+ <Animated.View
38
+ {...rest}
39
+ onLayout={composeOnLayoutHandlers(
40
+ resolvedOnLayout,
41
+ ctxValue.measureDynamic
42
+ )}
43
+ />
44
+ );
45
+ }