panelui-native 0.86.1 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/lib/module/components/animated-badge/index.js +451 -0
- package/lib/module/components/animated-badge/index.js.map +1 -0
- package/lib/module/components/bottom-sheet/index.js +17 -6
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/bubble-chart/index.js +1782 -0
- package/lib/module/components/bubble-chart/index.js.map +1 -0
- package/lib/module/components/feedback-dialog/index.js +474 -0
- package/lib/module/components/feedback-dialog/index.js.map +1 -0
- package/lib/module/components/pyramid-chart/index.js +1143 -0
- package/lib/module/components/pyramid-chart/index.js.map +1 -0
- package/lib/module/components/scroll-blur/index.js +363 -0
- package/lib/module/components/scroll-blur/index.js.map +1 -0
- package/lib/module/components/scroll-canvas/index.js +2 -0
- package/lib/module/components/scroll-canvas/index.js.map +1 -1
- package/lib/module/components/scroll-text/index.js +3 -0
- package/lib/module/components/scroll-text/index.js.map +1 -1
- package/lib/module/components/search-bar/index.js +753 -25
- package/lib/module/components/search-bar/index.js.map +1 -1
- package/lib/module/hooks/use-keyboard-avoidance.js +21 -1
- package/lib/module/hooks/use-keyboard-avoidance.js.map +1 -1
- package/lib/module/hooks/use-reveal-progress.js +21 -1
- package/lib/module/hooks/use-reveal-progress.js.map +1 -1
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/chart.js +24 -0
- package/lib/module/utils/chart.js.map +1 -1
- package/lib/typescript/src/components/animated-badge/index.d.ts +224 -0
- package/lib/typescript/src/components/animated-badge/index.d.ts.map +1 -0
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +1 -15
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bubble-chart/index.d.ts +481 -0
- package/lib/typescript/src/components/bubble-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/feedback-dialog/index.d.ts +156 -0
- package/lib/typescript/src/components/feedback-dialog/index.d.ts.map +1 -0
- package/lib/typescript/src/components/pyramid-chart/index.d.ts +328 -0
- package/lib/typescript/src/components/pyramid-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/scroll-blur/index.d.ts +113 -0
- package/lib/typescript/src/components/scroll-blur/index.d.ts.map +1 -0
- package/lib/typescript/src/components/scroll-canvas/index.d.ts.map +1 -1
- package/lib/typescript/src/components/search-bar/index.d.ts +350 -6
- package/lib/typescript/src/components/search-bar/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-keyboard-avoidance.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-reveal-progress.d.ts +6 -27
- package/lib/typescript/src/hooks/use-reveal-progress.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/chart.d.ts +14 -0
- package/lib/typescript/src/utils/chart.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/animated-badge/index.tsx +513 -0
- package/src/components/bottom-sheet/index.tsx +23 -8
- package/src/components/bubble-chart/index.tsx +2145 -0
- package/src/components/feedback-dialog/index.tsx +557 -0
- package/src/components/pyramid-chart/index.tsx +1360 -0
- package/src/components/scroll-blur/index.tsx +466 -0
- package/src/components/scroll-canvas/index.tsx +2 -1
- package/src/components/scroll-text/index.tsx +3 -3
- package/src/components/search-bar/index.tsx +933 -45
- package/src/hooks/use-keyboard-avoidance.ts +24 -1
- package/src/hooks/use-reveal-progress.ts +30 -1
- package/src/index.ts +72 -1
- package/src/utils/chart.ts +27 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cloneElement,
|
|
3
3
|
createContext,
|
|
4
|
+
forwardRef,
|
|
4
5
|
isValidElement,
|
|
5
6
|
useCallback,
|
|
6
7
|
useContext,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
useRef,
|
|
10
11
|
useState,
|
|
11
12
|
type ComponentProps,
|
|
13
|
+
type ComponentRef,
|
|
12
14
|
type ReactElement,
|
|
13
15
|
type ReactNode,
|
|
14
16
|
} from 'react';
|
|
@@ -29,6 +31,7 @@ import Animated, {
|
|
|
29
31
|
runOnJS,
|
|
30
32
|
useAnimatedScrollHandler,
|
|
31
33
|
useAnimatedStyle,
|
|
34
|
+
useComposedEventHandler,
|
|
32
35
|
useReducedMotion,
|
|
33
36
|
useSharedValue,
|
|
34
37
|
withSpring,
|
|
@@ -909,12 +912,10 @@ export interface BottomSheetBodyProps
|
|
|
909
912
|
* out — pull down on a list at its top and the sheet comes with you, pull
|
|
910
913
|
* down anywhere else and the list scrolls.
|
|
911
914
|
*/
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
...props
|
|
917
|
-
}: BottomSheetBodyProps) {
|
|
915
|
+
const BottomSheetBody = forwardRef<
|
|
916
|
+
ComponentRef<typeof Animated.ScrollView>,
|
|
917
|
+
BottomSheetBodyProps
|
|
918
|
+
>(function BottomSheetBody({ className, children, onScroll, ...props }, ref) {
|
|
918
919
|
const surface = useContext(SheetSurfaceContext);
|
|
919
920
|
|
|
920
921
|
useEffect(() => {
|
|
@@ -938,13 +939,27 @@ function BottomSheetBody({
|
|
|
938
939
|
if (scrollOffset) scrollOffset.value = event.contentOffset.y;
|
|
939
940
|
});
|
|
940
941
|
|
|
942
|
+
/*
|
|
943
|
+
* Composed, not replaced. A caller's `onScroll` arriving after this one used
|
|
944
|
+
* to take its place, which silently cost the sheet the position report its
|
|
945
|
+
* whole drag arrangement is built on — the list and the sheet went back to
|
|
946
|
+
* fighting over every downward swipe, and nothing said why.
|
|
947
|
+
*
|
|
948
|
+
* It has to be an animated handler for the same reason this one is.
|
|
949
|
+
*/
|
|
950
|
+
const composed = useComposedEventHandler([
|
|
951
|
+
handler,
|
|
952
|
+
(onScroll as typeof handler | undefined) ?? null,
|
|
953
|
+
]);
|
|
954
|
+
|
|
941
955
|
const body = (
|
|
942
956
|
<Animated.ScrollView
|
|
943
|
-
|
|
957
|
+
ref={ref}
|
|
944
958
|
scrollEventThrottle={16}
|
|
945
959
|
showsVerticalScrollIndicator={false}
|
|
946
960
|
className={cn('flex-1', className)}
|
|
947
961
|
{...props}
|
|
962
|
+
onScroll={composed}
|
|
948
963
|
>
|
|
949
964
|
{textChildren(children)}
|
|
950
965
|
</Animated.ScrollView>
|
|
@@ -957,7 +972,7 @@ function BottomSheetBody({
|
|
|
957
972
|
*/
|
|
958
973
|
if (!surface) return body;
|
|
959
974
|
return <GestureDetector gesture={surface.scrollGesture}>{body}</GestureDetector>;
|
|
960
|
-
}
|
|
975
|
+
});
|
|
961
976
|
BottomSheetBody.displayName = 'BottomSheet.Body';
|
|
962
977
|
|
|
963
978
|
export interface BottomSheetFooterProps extends ViewProps {
|