@impulse-ui-native/flyout 1.0.10 → 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/dist/index.d.mts +3 -1
- package/dist/index.js +343 -0
- package/dist/index.js.map +1 -0
- package/package.json +32 -22
- package/dist/index.cjs.js +0 -336
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.esm.js +0 -321
- package/dist/index.esm.js.map +0 -1
- package/src/components/flyout-handle.tsx +0 -49
- package/src/components/flyout-title.tsx +0 -45
- package/src/components/flyout.tsx +0 -333
- package/src/components/index.ts +0 -1
- package/src/index.ts +0 -2
- package/src/types/flyout.types.ts +0 -6
- package/src/types/index.ts +0 -1
package/dist/index.cjs.js
DELETED
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
Flyout: () => Flyout
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
|
|
37
|
-
// src/components/flyout.tsx
|
|
38
|
-
var import_core = require("@impulse-ui-native/core");
|
|
39
|
-
var import_safe_area_view = require("@impulse-ui-native/safe-area-view");
|
|
40
|
-
var import_theme3 = require("@impulse-ui-native/theme");
|
|
41
|
-
var import_view3 = require("@impulse-ui-native/view");
|
|
42
|
-
var import_react3 = require("react");
|
|
43
|
-
var import_react_native3 = require("react-native");
|
|
44
|
-
var import_react_native_gesture_handler = require("react-native-gesture-handler");
|
|
45
|
-
var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"));
|
|
46
|
-
var import_react_native_worklets = require("react-native-worklets");
|
|
47
|
-
|
|
48
|
-
// src/components/flyout-handle.tsx
|
|
49
|
-
var import_theme = require("@impulse-ui-native/theme");
|
|
50
|
-
var import_view = require("@impulse-ui-native/view");
|
|
51
|
-
var import_react = require("react");
|
|
52
|
-
var import_react_native = require("react-native");
|
|
53
|
-
var import_react_native_reanimated = __toESM(require("react-native-reanimated"));
|
|
54
|
-
var FlyoutHandleHeight = 32;
|
|
55
|
-
var FlyoutHandle = (0, import_react.memo)(function FlyoutHandle2(props) {
|
|
56
|
-
const theme = (0, import_theme.useTheme)();
|
|
57
|
-
const styles = (0, import_react.useMemo)(
|
|
58
|
-
() => themedStyles(theme, props.placement),
|
|
59
|
-
[theme, props.placement]
|
|
60
|
-
);
|
|
61
|
-
return /* @__PURE__ */ React.createElement(import_react_native_reanimated.default.View, { style: styles.flyoutHandleContainer }, /* @__PURE__ */ React.createElement(import_view.View, { style: styles.flyoutHandle }));
|
|
62
|
-
});
|
|
63
|
-
var themedStyles = function(theme, placement) {
|
|
64
|
-
return import_react_native.StyleSheet.create({
|
|
65
|
-
flyoutHandle: {
|
|
66
|
-
alignSelf: "center",
|
|
67
|
-
backgroundColor: theme.colors.background.primary,
|
|
68
|
-
width: "25%",
|
|
69
|
-
height: 6,
|
|
70
|
-
borderRadius: theme.radii.round
|
|
71
|
-
},
|
|
72
|
-
flyoutHandleContainer: {
|
|
73
|
-
position: "absolute",
|
|
74
|
-
top: placement === "bottom" ? -FlyoutHandleHeight : void 0,
|
|
75
|
-
bottom: placement === "top" ? -FlyoutHandleHeight : void 0,
|
|
76
|
-
width: "100%",
|
|
77
|
-
justifyContent: "center",
|
|
78
|
-
alignItems: "center",
|
|
79
|
-
height: FlyoutHandleHeight
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
// src/components/flyout-title.tsx
|
|
85
|
-
var import_theme2 = require("@impulse-ui-native/theme");
|
|
86
|
-
var import_typography = require("@impulse-ui-native/typography");
|
|
87
|
-
var import_view2 = require("@impulse-ui-native/view");
|
|
88
|
-
var import_react2 = require("react");
|
|
89
|
-
var import_react_native2 = require("react-native");
|
|
90
|
-
var FlyoutTitle = (0, import_react2.memo)(function FlyoutTitle2(props) {
|
|
91
|
-
const theme = (0, import_theme2.useTheme)();
|
|
92
|
-
const styles = (0, import_react2.useMemo)(
|
|
93
|
-
() => themedStyles2(theme, props.placement),
|
|
94
|
-
[theme, props.placement]
|
|
95
|
-
);
|
|
96
|
-
const title = (0, import_react2.useMemo)(() => {
|
|
97
|
-
if (typeof props.title === "string") {
|
|
98
|
-
return /* @__PURE__ */ React.createElement(import_typography.Typography.Title3, null, props.title);
|
|
99
|
-
}
|
|
100
|
-
return props.title;
|
|
101
|
-
}, [props.title]);
|
|
102
|
-
if (!props.title) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
return /* @__PURE__ */ React.createElement(import_view2.View, { style: styles.container }, title);
|
|
106
|
-
});
|
|
107
|
-
var themedStyles2 = function(theme, placement) {
|
|
108
|
-
return import_react_native2.StyleSheet.create({
|
|
109
|
-
container: {
|
|
110
|
-
borderTopLeftRadius: placement === "bottom" ? theme.radii.xl : void 0,
|
|
111
|
-
borderTopRightRadius: placement === "bottom" ? theme.radii.xl : void 0,
|
|
112
|
-
backgroundColor: theme.colors.background.secondary,
|
|
113
|
-
padding: theme.spacing.mxs,
|
|
114
|
-
alignItems: "center"
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
// src/components/flyout.tsx
|
|
120
|
-
var EnterAnimationConfig = {
|
|
121
|
-
damping: 50,
|
|
122
|
-
stiffness: 300,
|
|
123
|
-
mass: 1,
|
|
124
|
-
overshootClamping: true
|
|
125
|
-
};
|
|
126
|
-
var ExitAnimationConfig = {
|
|
127
|
-
duration: 150,
|
|
128
|
-
easing: import_react_native_reanimated2.Easing.in(import_react_native_reanimated2.Easing.quad)
|
|
129
|
-
};
|
|
130
|
-
var StickyHeaderIndices = [0];
|
|
131
|
-
var ScreenHeight = import_react_native3.Dimensions.get("screen").height;
|
|
132
|
-
var MaxHeight = ScreenHeight * 0.9;
|
|
133
|
-
var AndroidOverScroll = import_react_native3.Platform.OS === "android" ? { overScrollMode: "always" } : {};
|
|
134
|
-
var Flyout = (0, import_react3.memo)(function Flyout2({
|
|
135
|
-
children,
|
|
136
|
-
placement = "bottom",
|
|
137
|
-
...props
|
|
138
|
-
}) {
|
|
139
|
-
const colors = (0, import_theme3.useColors)();
|
|
140
|
-
const theme = (0, import_theme3.useTheme)();
|
|
141
|
-
const [measuredHeight, setMeasuredHeight] = (0, import_react3.useState)(null);
|
|
142
|
-
const [bounceEnabled, setBounceEnabled] = (0, import_react3.useState)(placement !== "bottom");
|
|
143
|
-
const [viewportHeight, setViewportHeight] = (0, import_react3.useState)(0);
|
|
144
|
-
const [contentHeight, setContentHeight] = (0, import_react3.useState)(0);
|
|
145
|
-
const didOpen = (0, import_react3.useRef)(false);
|
|
146
|
-
const canDismiss = (0, import_react_native_reanimated2.useSharedValue)(placement === "bottom");
|
|
147
|
-
const scrollY = (0, import_react_native_reanimated2.useSharedValue)(0);
|
|
148
|
-
const maxScrollY = (0, import_react_native_reanimated2.useSharedValue)(0);
|
|
149
|
-
const translateY = (0, import_react_native_reanimated2.useSharedValue)(
|
|
150
|
-
placement === "top" ? -ScreenHeight : ScreenHeight
|
|
151
|
-
);
|
|
152
|
-
const opacity = (0, import_react_native_reanimated2.useSharedValue)(0);
|
|
153
|
-
const isScrollable = (0, import_react3.useMemo)(
|
|
154
|
-
() => contentHeight > viewportHeight,
|
|
155
|
-
[contentHeight, viewportHeight]
|
|
156
|
-
);
|
|
157
|
-
const onScroll = (0, import_react_native_reanimated2.useAnimatedScrollHandler)({
|
|
158
|
-
onScroll(event) {
|
|
159
|
-
scrollY.value = event.contentOffset.y;
|
|
160
|
-
maxScrollY.value = Math.max(
|
|
161
|
-
0,
|
|
162
|
-
event.contentSize.height - event.layoutMeasurement.height
|
|
163
|
-
);
|
|
164
|
-
},
|
|
165
|
-
onMomentumEnd(event) {
|
|
166
|
-
if (placement === "bottom" && event.contentOffset.y <= 0) {
|
|
167
|
-
(0, import_react_native_worklets.scheduleOnRN)(setBounceEnabled, false);
|
|
168
|
-
canDismiss.value = true;
|
|
169
|
-
}
|
|
170
|
-
if (placement === "top" && scrollY.value >= maxScrollY.value - 1) {
|
|
171
|
-
(0, import_react_native_worklets.scheduleOnRN)(setBounceEnabled, false);
|
|
172
|
-
canDismiss.value = true;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
const onLayout = (0, import_core.useEventCallback)((event) => {
|
|
177
|
-
if (!didOpen.current && measuredHeight === null) {
|
|
178
|
-
const rawHeight = event.nativeEvent.layout.height;
|
|
179
|
-
const clampedHeight = Math.min(rawHeight, MaxHeight);
|
|
180
|
-
setMeasuredHeight(clampedHeight);
|
|
181
|
-
translateY.value = placement === "top" ? -clampedHeight : clampedHeight;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
const onLayoutScrollview = (0, import_core.useEventCallback)((event) => {
|
|
185
|
-
setViewportHeight(event.nativeEvent.layout.height);
|
|
186
|
-
});
|
|
187
|
-
const onContentSizeChange = (0, import_core.useEventCallback)(
|
|
188
|
-
(_contentWidth, contentHeight2) => {
|
|
189
|
-
setContentHeight(contentHeight2);
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
const animateOut = (0, import_core.useEventCallback)(() => {
|
|
193
|
-
if (measuredHeight) {
|
|
194
|
-
const target = placement === "top" ? -measuredHeight : measuredHeight;
|
|
195
|
-
translateY.value = (0, import_react_native_reanimated2.withTiming)(target, ExitAnimationConfig, (finished) => {
|
|
196
|
-
if (finished && props.onCloseFinished) {
|
|
197
|
-
(0, import_react_native_worklets.scheduleOnRN)(props.onCloseFinished, props.id);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
opacity.value = (0, import_react_native_reanimated2.withTiming)(0, ExitAnimationConfig);
|
|
201
|
-
didOpen.current = false;
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
const onPanGestureEnd = (0, import_core.useEventCallback)(
|
|
205
|
-
(event) => {
|
|
206
|
-
if (!measuredHeight) return;
|
|
207
|
-
let shouldClose = false;
|
|
208
|
-
if (placement === "bottom") {
|
|
209
|
-
shouldClose = event.translationY > measuredHeight * 0.5 || event.velocityY > 1500;
|
|
210
|
-
}
|
|
211
|
-
if (placement === "top") {
|
|
212
|
-
shouldClose = event.translationY < -measuredHeight * 0.5 || event.velocityY < -1500;
|
|
213
|
-
}
|
|
214
|
-
if (shouldClose && (canDismiss.value || !isScrollable)) {
|
|
215
|
-
animateOut();
|
|
216
|
-
} else {
|
|
217
|
-
translateY.value = (0, import_react_native_reanimated2.withSpring)(0, EnterAnimationConfig);
|
|
218
|
-
opacity.value = (0, import_react_native_reanimated2.withSpring)(0.4, EnterAnimationConfig);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
);
|
|
222
|
-
const onPanGestureHandleEnd = (0, import_core.useEventCallback)(
|
|
223
|
-
(event) => {
|
|
224
|
-
onPanGestureEnd(event);
|
|
225
|
-
if (placement === "bottom" && scrollY.value > 0) {
|
|
226
|
-
canDismiss.value = false;
|
|
227
|
-
}
|
|
228
|
-
if (placement === "top" && scrollY.value < maxScrollY.value - 1) {
|
|
229
|
-
canDismiss.value = false;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
);
|
|
233
|
-
const onPanGestureUpdate = (event) => {
|
|
234
|
-
if (placement === "bottom" && event.translationY < 0) {
|
|
235
|
-
(0, import_react_native_worklets.scheduleOnRN)(setBounceEnabled, true);
|
|
236
|
-
canDismiss.value = false;
|
|
237
|
-
}
|
|
238
|
-
if (placement === "top" && event.translationY > 0) {
|
|
239
|
-
(0, import_react_native_worklets.scheduleOnRN)(setBounceEnabled, true);
|
|
240
|
-
canDismiss.value = false;
|
|
241
|
-
}
|
|
242
|
-
if (placement === "bottom" && event.translationY < 0 || placement === "top" && event.translationY > 0) {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
if (canDismiss.value || !isScrollable) {
|
|
246
|
-
translateY.value = event.translationY;
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
const onPanGestureHandleUpdate = (event) => {
|
|
250
|
-
canDismiss.value = true;
|
|
251
|
-
if (placement === "bottom" && event.translationY < 0 || placement === "top" && event.translationY > 0) {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
translateY.value = event.translationY;
|
|
255
|
-
};
|
|
256
|
-
const panGesture = import_react_native_gesture_handler.Gesture.Pan().onUpdate(onPanGestureUpdate).onEnd((event) => (0, import_react_native_worklets.scheduleOnRN)(onPanGestureEnd, event));
|
|
257
|
-
const gesture = import_react_native_gesture_handler.Gesture.Simultaneous(import_react_native_gesture_handler.Gesture.Native(), panGesture);
|
|
258
|
-
const handleGesture = import_react_native_gesture_handler.Gesture.Pan().onUpdate(onPanGestureHandleUpdate).onEnd((event) => (0, import_react_native_worklets.scheduleOnRN)(onPanGestureHandleEnd, event));
|
|
259
|
-
const animatedStyle = (0, import_react_native_reanimated2.useAnimatedStyle)(() => ({
|
|
260
|
-
transform: [{ translateY: translateY.value }],
|
|
261
|
-
zIndex: 100 + props.layer
|
|
262
|
-
}));
|
|
263
|
-
const overlayStyle = (0, import_react_native_reanimated2.useAnimatedStyle)(() => ({
|
|
264
|
-
opacity: opacity.value,
|
|
265
|
-
zIndex: 100 + props.layer,
|
|
266
|
-
backgroundColor: colors.black
|
|
267
|
-
}));
|
|
268
|
-
const edges = (0, import_react3.useMemo)(() => {
|
|
269
|
-
return [placement, "left", "right"];
|
|
270
|
-
}, [placement]);
|
|
271
|
-
const styles = (0, import_react3.useMemo)(
|
|
272
|
-
() => themedStyles3(theme, placement),
|
|
273
|
-
[theme, placement]
|
|
274
|
-
);
|
|
275
|
-
(0, import_react3.useEffect)(() => {
|
|
276
|
-
if (measuredHeight === null || didOpen.current || !props.open) return;
|
|
277
|
-
translateY.value = (0, import_react_native_reanimated2.withSpring)(0, EnterAnimationConfig);
|
|
278
|
-
opacity.value = (0, import_react_native_reanimated2.withSpring)(0.4, EnterAnimationConfig);
|
|
279
|
-
didOpen.current = true;
|
|
280
|
-
}, [measuredHeight, props.open]);
|
|
281
|
-
return /* @__PURE__ */ React.createElement(import_react3.Fragment, null, /* @__PURE__ */ React.createElement(import_react_native_reanimated2.default.View, { style: [import_react_native3.StyleSheet.absoluteFill, overlayStyle] }, /* @__PURE__ */ React.createElement(import_react_native3.Pressable, { onPress: animateOut, style: import_react_native3.StyleSheet.absoluteFillObject })), /* @__PURE__ */ React.createElement(import_react_native_gesture_handler.GestureDetector, { gesture }, /* @__PURE__ */ React.createElement(import_react_native_reanimated2.default.View, { style: [styles.container, animatedStyle] }, /* @__PURE__ */ React.createElement(
|
|
282
|
-
import_safe_area_view.SafeAreaView,
|
|
283
|
-
{
|
|
284
|
-
edges,
|
|
285
|
-
style: styles.safeAreaView,
|
|
286
|
-
onLayout
|
|
287
|
-
},
|
|
288
|
-
placement === "bottom" ? /* @__PURE__ */ React.createElement(import_react_native_gesture_handler.GestureDetector, { gesture: handleGesture }, /* @__PURE__ */ React.createElement(FlyoutHandle, { placement })) : null,
|
|
289
|
-
/* @__PURE__ */ React.createElement(
|
|
290
|
-
import_react_native_reanimated2.default.ScrollView,
|
|
291
|
-
{
|
|
292
|
-
onLayout: onLayoutScrollview,
|
|
293
|
-
onContentSizeChange,
|
|
294
|
-
onScroll,
|
|
295
|
-
scrollEventThrottle: 16,
|
|
296
|
-
scrollEnabled: isScrollable,
|
|
297
|
-
bounces: isScrollable && bounceEnabled,
|
|
298
|
-
style: styles.scrollview,
|
|
299
|
-
stickyHeaderIndices: props.title ? StickyHeaderIndices : void 0,
|
|
300
|
-
showsHorizontalScrollIndicator: false,
|
|
301
|
-
showsVerticalScrollIndicator: false,
|
|
302
|
-
...AndroidOverScroll
|
|
303
|
-
},
|
|
304
|
-
props.title && /* @__PURE__ */ React.createElement(FlyoutTitle, { title: props.title }),
|
|
305
|
-
/* @__PURE__ */ React.createElement(import_view3.View, { padding: theme.spacing.sm }, children)
|
|
306
|
-
),
|
|
307
|
-
placement === "top" ? /* @__PURE__ */ React.createElement(import_react_native_gesture_handler.GestureDetector, { gesture: handleGesture }, /* @__PURE__ */ React.createElement(FlyoutHandle, { placement })) : null
|
|
308
|
-
))));
|
|
309
|
-
});
|
|
310
|
-
var themedStyles3 = function(theme, placement) {
|
|
311
|
-
return import_react_native3.StyleSheet.create({
|
|
312
|
-
container: {
|
|
313
|
-
position: "absolute",
|
|
314
|
-
[placement]: 0,
|
|
315
|
-
left: 0,
|
|
316
|
-
right: 0,
|
|
317
|
-
backgroundColor: theme.colors.background.secondary,
|
|
318
|
-
borderTopLeftRadius: placement === "bottom" ? theme.radii.xl : 0,
|
|
319
|
-
borderTopRightRadius: placement === "bottom" ? theme.radii.xl : 0,
|
|
320
|
-
borderBottomLeftRadius: placement === "top" ? theme.radii.xl : 0,
|
|
321
|
-
borderBottomRightRadius: placement === "top" ? theme.radii.xl : 0
|
|
322
|
-
},
|
|
323
|
-
scrollview: {
|
|
324
|
-
borderTopLeftRadius: placement === "bottom" ? theme.radii.xl : 0,
|
|
325
|
-
borderTopRightRadius: placement === "bottom" ? theme.radii.xl : 0,
|
|
326
|
-
borderBottomLeftRadius: placement === "top" ? theme.radii.xl : 0,
|
|
327
|
-
borderBottomRightRadius: placement === "top" ? theme.radii.xl : 0
|
|
328
|
-
},
|
|
329
|
-
safeAreaView: { maxHeight: MaxHeight }
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
333
|
-
0 && (module.exports = {
|
|
334
|
-
Flyout
|
|
335
|
-
});
|
|
336
|
-
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/components/flyout.tsx","../src/components/flyout-handle.tsx","../src/components/flyout-title.tsx"],"sourcesContent":["export * from \"./components\";\r\nexport * from \"./types\";\r\n","import { useEventCallback } from \"@impulse-ui-native/core\";\r\nimport { SafeAreaView } from \"@impulse-ui-native/safe-area-view\";\r\nimport { AppTheme, useColors, useTheme } from \"@impulse-ui-native/theme\";\r\nimport { View } from \"@impulse-ui-native/view\";\r\nimport {\r\n Fragment,\r\n memo,\r\n PropsWithChildren,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from \"react\";\r\nimport {\r\n Dimensions,\r\n LayoutChangeEvent,\r\n Platform,\r\n Pressable,\r\n StyleSheet,\r\n} from \"react-native\";\r\nimport {\r\n Gesture,\r\n GestureDetector,\r\n GestureStateChangeEvent,\r\n GestureUpdateEvent,\r\n PanGestureHandlerEventPayload,\r\n} from \"react-native-gesture-handler\";\r\nimport Animated, {\r\n Easing,\r\n useAnimatedScrollHandler,\r\n useAnimatedStyle,\r\n useSharedValue,\r\n withSpring,\r\n withTiming,\r\n} from \"react-native-reanimated\";\r\nimport { Edge } from \"react-native-safe-area-context\";\r\nimport { scheduleOnRN } from \"react-native-worklets\";\n\r\nimport { FlyoutProps } from \"../types\";\n\r\nimport { FlyoutHandle } from \"./flyout-handle\";\r\nimport { FlyoutTitle } from \"./flyout-title\";\r\n\r\nconst EnterAnimationConfig = {\r\n damping: 50,\r\n stiffness: 300,\r\n mass: 1,\r\n overshootClamping: true,\r\n};\r\n\r\nconst ExitAnimationConfig = {\r\n duration: 150,\r\n easing: Easing.in(Easing.quad),\r\n};\r\n\r\nconst StickyHeaderIndices = [0];\r\nconst ScreenHeight = Dimensions.get(\"screen\").height;\r\nconst MaxHeight = ScreenHeight * 0.9;\r\n\r\nconst AndroidOverScroll =\r\n Platform.OS === \"android\" ? { overScrollMode: \"always\" as const } : {};\r\n\r\nexport const Flyout = memo(function Flyout({\r\n children,\r\n placement = \"bottom\",\r\n ...props\r\n}: PropsWithChildren<FlyoutProps>) {\r\n const colors = useColors();\r\n const theme = useTheme();\r\n\r\n const [measuredHeight, setMeasuredHeight] = useState<number | null>(null);\r\n const [bounceEnabled, setBounceEnabled] = useState(placement !== \"bottom\");\r\n const [viewportHeight, setViewportHeight] = useState(0);\r\n const [contentHeight, setContentHeight] = useState(0);\r\n\r\n const didOpen = useRef(false);\r\n const canDismiss = useSharedValue(placement === \"bottom\");\r\n const scrollY = useSharedValue(0);\r\n const maxScrollY = useSharedValue(0);\r\n\r\n const translateY = useSharedValue(\r\n placement === \"top\" ? -ScreenHeight : ScreenHeight\r\n );\r\n const opacity = useSharedValue(0);\r\n\r\n const isScrollable = useMemo(\r\n () => contentHeight > viewportHeight,\r\n [contentHeight, viewportHeight]\r\n );\r\n\r\n const onScroll = useAnimatedScrollHandler({\r\n onScroll(event) {\r\n scrollY.value = event.contentOffset.y;\r\n maxScrollY.value = Math.max(\r\n 0,\r\n event.contentSize.height - event.layoutMeasurement.height\r\n );\r\n },\r\n onMomentumEnd(event) {\r\n if (placement === \"bottom\" && event.contentOffset.y <= 0) {\r\n scheduleOnRN(setBounceEnabled, false);\r\n canDismiss.value = true;\r\n }\r\n\r\n if (placement === \"top\" && scrollY.value >= maxScrollY.value - 1) {\r\n scheduleOnRN(setBounceEnabled, false);\r\n canDismiss.value = true;\r\n }\r\n },\r\n });\r\n\r\n const onLayout = useEventCallback((event: LayoutChangeEvent) => {\r\n if (!didOpen.current && measuredHeight === null) {\r\n const rawHeight = event.nativeEvent.layout.height;\r\n const clampedHeight = Math.min(rawHeight, MaxHeight);\r\n setMeasuredHeight(clampedHeight);\r\n translateY.value = placement === \"top\" ? -clampedHeight : clampedHeight;\r\n }\r\n });\r\n\r\n const onLayoutScrollview = useEventCallback((event: LayoutChangeEvent) => {\r\n setViewportHeight(event.nativeEvent.layout.height);\r\n });\r\n\r\n const onContentSizeChange = useEventCallback(\r\n (_contentWidth: number, contentHeight: number) => {\r\n setContentHeight(contentHeight);\r\n }\r\n );\r\n\r\n const animateOut = useEventCallback(() => {\r\n if (measuredHeight) {\r\n const target = placement === \"top\" ? -measuredHeight : measuredHeight;\r\n\r\n translateY.value = withTiming(target, ExitAnimationConfig, (finished) => {\r\n if (finished && props.onCloseFinished) {\r\n scheduleOnRN(props.onCloseFinished, props.id);\r\n }\r\n });\r\n\r\n opacity.value = withTiming(0, ExitAnimationConfig);\r\n didOpen.current = false;\r\n }\r\n });\r\n\r\n const onPanGestureEnd = useEventCallback(\r\n (event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {\r\n if (!measuredHeight) return;\r\n\r\n let shouldClose = false;\r\n\r\n if (placement === \"bottom\") {\r\n shouldClose =\r\n event.translationY > measuredHeight * 0.5 || event.velocityY > 1500;\r\n }\r\n\r\n if (placement === \"top\") {\r\n shouldClose =\r\n event.translationY < -measuredHeight * 0.5 || event.velocityY < -1500;\r\n }\r\n\r\n if (shouldClose && (canDismiss.value || !isScrollable)) {\r\n animateOut();\r\n } else {\r\n translateY.value = withSpring(0, EnterAnimationConfig);\r\n opacity.value = withSpring(0.4, EnterAnimationConfig);\r\n }\r\n }\r\n );\r\n\r\n const onPanGestureHandleEnd = useEventCallback(\r\n (event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {\r\n onPanGestureEnd(event);\r\n\r\n if (placement === \"bottom\" && scrollY.value > 0) {\r\n canDismiss.value = false;\r\n }\r\n\r\n if (placement === \"top\" && scrollY.value < maxScrollY.value - 1) {\r\n canDismiss.value = false;\r\n }\r\n }\r\n );\r\n\r\n const onPanGestureUpdate = (\r\n event: GestureUpdateEvent<PanGestureHandlerEventPayload>\r\n ) => {\r\n if (placement === \"bottom\" && event.translationY < 0) {\r\n scheduleOnRN(setBounceEnabled, true);\r\n canDismiss.value = false;\r\n }\r\n\r\n if (placement === \"top\" && event.translationY > 0) {\r\n scheduleOnRN(setBounceEnabled, true);\r\n canDismiss.value = false;\r\n }\r\n\r\n if (\r\n (placement === \"bottom\" && event.translationY < 0) ||\r\n (placement === \"top\" && event.translationY > 0)\r\n ) {\r\n return;\r\n }\r\n\r\n if (canDismiss.value || !isScrollable) {\r\n translateY.value = event.translationY;\r\n }\r\n };\r\n\r\n const onPanGestureHandleUpdate = (\r\n event: GestureUpdateEvent<PanGestureHandlerEventPayload>\r\n ) => {\r\n canDismiss.value = true;\r\n\r\n if (\r\n (placement === \"bottom\" && event.translationY < 0) ||\r\n (placement === \"top\" && event.translationY > 0)\r\n ) {\r\n return;\r\n }\r\n\r\n translateY.value = event.translationY;\r\n };\r\n\r\n const panGesture = Gesture.Pan()\r\n .onUpdate(onPanGestureUpdate)\r\n .onEnd((event) => scheduleOnRN(onPanGestureEnd, event));\r\n\r\n const gesture = Gesture.Simultaneous(Gesture.Native(), panGesture);\r\n\r\n const handleGesture = Gesture.Pan()\r\n .onUpdate(onPanGestureHandleUpdate)\r\n .onEnd((event) => scheduleOnRN(onPanGestureHandleEnd, event));\r\n\r\n const animatedStyle = useAnimatedStyle(() => ({\r\n transform: [{ translateY: translateY.value }],\r\n zIndex: 100 + props.layer,\r\n }));\r\n\r\n const overlayStyle = useAnimatedStyle(() => ({\r\n opacity: opacity.value,\r\n zIndex: 100 + props.layer,\r\n backgroundColor: colors.black,\r\n }));\r\n\r\n const edges = useMemo<Edge[]>(() => {\r\n return [placement, \"left\", \"right\"];\r\n }, [placement]);\r\n\r\n const styles = useMemo(\r\n () => themedStyles(theme, placement),\r\n [theme, placement]\r\n );\r\n\r\n useEffect(() => {\r\n if (measuredHeight === null || didOpen.current || !props.open) return;\r\n\r\n translateY.value = withSpring(0, EnterAnimationConfig);\r\n opacity.value = withSpring(0.4, EnterAnimationConfig);\r\n didOpen.current = true;\r\n }, [measuredHeight, props.open]);\r\n\r\n return (\r\n <Fragment>\r\n <Animated.View style={[StyleSheet.absoluteFill, overlayStyle]}>\r\n <Pressable onPress={animateOut} style={StyleSheet.absoluteFillObject} />\r\n </Animated.View>\r\n <GestureDetector gesture={gesture}>\r\n <Animated.View style={[styles.container, animatedStyle]}>\r\n <SafeAreaView\r\n edges={edges}\r\n style={styles.safeAreaView}\r\n onLayout={onLayout}\r\n >\r\n {placement === \"bottom\" ? (\r\n <GestureDetector gesture={handleGesture}>\r\n <FlyoutHandle placement={placement} />\r\n </GestureDetector>\r\n ) : null}\r\n\r\n <Animated.ScrollView\r\n onLayout={onLayoutScrollview}\r\n onContentSizeChange={onContentSizeChange}\r\n onScroll={onScroll}\r\n scrollEventThrottle={16}\r\n scrollEnabled={isScrollable}\r\n bounces={isScrollable && bounceEnabled}\r\n style={styles.scrollview}\r\n stickyHeaderIndices={\r\n props.title ? StickyHeaderIndices : undefined\r\n }\r\n showsHorizontalScrollIndicator={false}\r\n showsVerticalScrollIndicator={false}\r\n {...AndroidOverScroll}\r\n >\r\n {props.title && <FlyoutTitle title={props.title} />}\r\n <View padding={theme.spacing.sm}>{children}</View>\r\n </Animated.ScrollView>\r\n\r\n {placement === \"top\" ? (\r\n <GestureDetector gesture={handleGesture}>\r\n <FlyoutHandle placement={placement} />\r\n </GestureDetector>\r\n ) : null}\r\n </SafeAreaView>\r\n </Animated.View>\r\n </GestureDetector>\r\n </Fragment>\r\n );\r\n});\r\n\r\nconst themedStyles = function (theme: AppTheme, placement: \"top\" | \"bottom\") {\r\n return StyleSheet.create({\r\n container: {\r\n position: \"absolute\",\r\n [placement]: 0,\r\n left: 0,\r\n right: 0,\r\n backgroundColor: theme.colors.background.secondary,\r\n borderTopLeftRadius: placement === \"bottom\" ? theme.radii.xl : 0,\r\n borderTopRightRadius: placement === \"bottom\" ? theme.radii.xl : 0,\r\n borderBottomLeftRadius: placement === \"top\" ? theme.radii.xl : 0,\r\n borderBottomRightRadius: placement === \"top\" ? theme.radii.xl : 0,\r\n },\r\n scrollview: {\r\n borderTopLeftRadius: placement === \"bottom\" ? theme.radii.xl : 0,\r\n borderTopRightRadius: placement === \"bottom\" ? theme.radii.xl : 0,\r\n borderBottomLeftRadius: placement === \"top\" ? theme.radii.xl : 0,\r\n borderBottomRightRadius: placement === \"top\" ? theme.radii.xl : 0,\r\n },\r\n safeAreaView: { maxHeight: MaxHeight },\r\n });\r\n};\r\n","import { AppTheme, useTheme } from \"@impulse-ui-native/theme\";\r\nimport { View } from \"@impulse-ui-native/view\";\r\nimport { memo, useMemo } from \"react\";\r\nimport { StyleSheet } from \"react-native\";\r\nimport Animated from \"react-native-reanimated\";\r\n\r\nconst FlyoutHandleHeight = 32;\r\n\r\ninterface FlyoutHandleProps {\r\n placement: \"top\" | \"bottom\";\r\n}\r\n\r\nexport const FlyoutHandle = memo(function FlyoutHandle(\r\n props: FlyoutHandleProps\r\n) {\r\n const theme = useTheme();\r\n\r\n const styles = useMemo(\r\n () => themedStyles(theme, props.placement),\r\n [theme, props.placement]\r\n );\r\n\r\n return (\r\n <Animated.View style={styles.flyoutHandleContainer}>\r\n <View style={styles.flyoutHandle} />\r\n </Animated.View>\r\n );\r\n});\r\n\r\nconst themedStyles = function (theme: AppTheme, placement: \"top\" | \"bottom\") {\r\n return StyleSheet.create({\r\n flyoutHandle: {\r\n alignSelf: \"center\",\r\n backgroundColor: theme.colors.background.primary,\r\n width: \"25%\",\r\n height: 6,\r\n borderRadius: theme.radii.round,\r\n },\r\n flyoutHandleContainer: {\r\n position: \"absolute\",\r\n top: placement === \"bottom\" ? -FlyoutHandleHeight : undefined,\r\n bottom: placement === \"top\" ? -FlyoutHandleHeight : undefined,\r\n width: \"100%\",\r\n justifyContent: \"center\",\r\n alignItems: \"center\",\r\n height: FlyoutHandleHeight,\r\n },\r\n });\r\n};\r\n","import { AppTheme, useTheme } from \"@impulse-ui-native/theme\";\r\nimport { Typography } from \"@impulse-ui-native/typography\";\r\nimport { View } from \"@impulse-ui-native/view\";\r\nimport { memo, ReactNode, useMemo } from \"react\";\r\nimport { StyleSheet } from \"react-native\";\r\n\r\ninterface FlyoutTitleProps {\r\n title?: ReactNode | string;\r\n placement?: \"top\" | \"bottom\";\r\n}\r\n\r\nexport const FlyoutTitle = memo(function FlyoutTitle(props: FlyoutTitleProps) {\r\n const theme = useTheme();\r\n\r\n const styles = useMemo(\r\n () => themedStyles(theme, props.placement),\r\n [theme, props.placement]\r\n );\r\n\r\n const title = useMemo(() => {\r\n if (typeof props.title === \"string\") {\r\n return <Typography.Title3>{props.title}</Typography.Title3>;\r\n }\r\n\r\n return props.title;\r\n }, [props.title]);\r\n\r\n if (!props.title) {\r\n return null;\r\n }\r\n\r\n return <View style={styles.container}>{title}</View>;\r\n});\r\n\r\nconst themedStyles = function (theme: AppTheme, placement?: \"top\" | \"bottom\") {\r\n return StyleSheet.create({\r\n container: {\r\n borderTopLeftRadius: placement === \"bottom\" ? theme.radii.xl : undefined,\r\n borderTopRightRadius: placement === \"bottom\" ? theme.radii.xl : undefined,\r\n backgroundColor: theme.colors.background.secondary,\r\n padding: theme.spacing.mxs,\r\n alignItems: \"center\",\r\n },\r\n });\r\n};\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAiC;AACjC,4BAA6B;AAC7B,IAAAA,gBAA8C;AAC9C,IAAAC,eAAqB;AACrB,IAAAC,gBAQO;AACP,IAAAC,uBAMO;AACP,0CAMO;AACP,IAAAC,kCAOO;AAEP,mCAA6B;;;ACpC7B,mBAAmC;AACnC,kBAAqB;AACrB,mBAA8B;AAC9B,0BAA2B;AAC3B,qCAAqB;AAErB,IAAM,qBAAqB;AAMpB,IAAM,mBAAe,mBAAK,SAASC,cACxC,OACA;AACA,QAAM,YAAQ,uBAAS;AAEvB,QAAM,aAAS;AAAA,IACb,MAAM,aAAa,OAAO,MAAM,SAAS;AAAA,IACzC,CAAC,OAAO,MAAM,SAAS;AAAA,EACzB;AAEA,SACE,oCAAC,+BAAAC,QAAS,MAAT,EAAc,OAAO,OAAO,yBAC3B,oCAAC,oBAAK,OAAO,OAAO,cAAc,CACpC;AAEJ,CAAC;AAED,IAAM,eAAe,SAAU,OAAiB,WAA6B;AAC3E,SAAO,+BAAW,OAAO;AAAA,IACvB,cAAc;AAAA,MACZ,WAAW;AAAA,MACX,iBAAiB,MAAM,OAAO,WAAW;AAAA,MACzC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,uBAAuB;AAAA,MACrB,UAAU;AAAA,MACV,KAAK,cAAc,WAAW,CAAC,qBAAqB;AAAA,MACpD,QAAQ,cAAc,QAAQ,CAAC,qBAAqB;AAAA,MACpD,OAAO;AAAA,MACP,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,QAAQ;AAAA,IACV;AAAA,EACF,CAAC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AsB;AAAA,QAEtC,gCAAgC;AAAA,QAChC,8BAA8B;AAAA,QAC7B,GAAG;AAAA;AAAA,MAEH,MAAM,SAAS,oCAAC,eAAY,OAAO,MAAM,OAAO;AAAA,MACjD,oCAAC,qBAAK,SAAS,MAAM,QAAQ,MAAK,QAAS;AAAA,IAC7C;AAAA,IAEC,cAAc,QACb,oCAAC,uDAAgB,SAAS,iBACxB,oCAAC,gBAAa,WAAsB,CACtC,IACE;AAAA,EACN,CACF,CACF,CACF;AAEJ,CAAC;AAED,IAAMD,gBAAe,SAAU,OAAiB,WAA6B;AAC3E,SAAO,gCAAW,OAAO;AAAA,IACvB,WAAW;AAAA,MACT,UAAU;AAAA,MACV,CAAC,SAAS,GAAG;AAAA,MACb,MAAM;AAAA,MACN,OAAO;AAAA,MACP,iBAAiB,MAAM,OAAO,WAAW;AAAA,MACzC,qBAAqB,cAAc,WAAW,MAAM,MAAM,KAAK;AAAA,MAC/D,sBAAsB,cAAc,WAAW,MAAM,MAAM,KAAK;AAAA,MAChE,wBAAwB,cAAc,QAAQ,MAAM,MAAM,KAAK;AAAA,MAC/D,yBAAyB,cAAc,QAAQ,MAAM,MAAM,KAAK;AAAA,IAClE;AAAA,IACA,YAAY;AAAA,MACV,qBAAqB,cAAc,WAAW,MAAM,MAAM,KAAK;AAAA,MAC/D,sBAAsB,cAAc,WAAW,MAAM,MAAM,KAAK;AAAA,MAChE,wBAAwB,cAAc,QAAQ,MAAM,MAAM,KAAK;AAAA,MAC/D,yBAAyB,cAAc,QAAQ,MAAM,MAAM,KAAK;AAAA,IAClE;AAAA,IACA,cAAc,EAAE,WAAW,UAAU;AAAA,EACvC,CAAC;AACH;","names":["import_theme","import_view","import_react","import_react_native","import_react_native_reanimated","FlyoutHandle","Animated","import_theme","import_view","import_react","import_react_native","FlyoutTitle","themedStyles","Flyout","contentHeight","themedStyles","Animated"]}
|
package/dist/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { PropsWithChildren } from 'react';
|
|
3
|
-
import { LayerComponentBaseProps } from '@impulse-ui-native/layer-manager-types';
|
|
4
|
-
|
|
5
|
-
interface FlyoutProps extends LayerComponentBaseProps {
|
|
6
|
-
open?: boolean;
|
|
7
|
-
placement?: "top" | "bottom";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare const Flyout: react.NamedExoticComponent<PropsWithChildren<FlyoutProps>>;
|
|
11
|
-
|
|
12
|
-
export { Flyout, type FlyoutProps };
|