react-native-toast-signal 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +353 -0
- package/lib/module/components/signal-item.js +482 -0
- package/lib/module/components/signal-item.js.map +1 -0
- package/lib/module/constants.js +62 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/core/store.js +158 -0
- package/lib/module/core/store.js.map +1 -0
- package/lib/module/hooks/useSignal.js +71 -0
- package/lib/module/hooks/useSignal.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/provider/signal-provider.js +72 -0
- package/lib/module/provider/signal-provider.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/signal-item.d.ts +7 -0
- package/lib/typescript/src/components/signal-item.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +12 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/core/store.d.ts +48 -0
- package/lib/typescript/src/core/store.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSignal.d.ts +46 -0
- package/lib/typescript/src/hooks/useSignal.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/provider/signal-provider.d.ts +7 -0
- package/lib/typescript/src/provider/signal-provider.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +73 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +174 -0
- package/src/components/signal-item.tsx +548 -0
- package/src/constants.ts +62 -0
- package/src/core/store.ts +171 -0
- package/src/hooks/useSignal.ts +116 -0
- package/src/index.tsx +3 -0
- package/src/provider/signal-provider.tsx +89 -0
- package/src/types.ts +88 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
import { Text, StyleSheet, View, Pressable, AccessibilityInfo, Platform } from 'react-native';
|
|
5
|
+
import Animated, { useSharedValue, useAnimatedStyle, withTiming, withRepeat, useDerivedValue, cancelAnimation, Easing } from 'react-native-reanimated';
|
|
6
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
7
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
8
|
+
import { ENTRY_OFFSET_Y, SCALE_STEP, STACK_OFFSET, SWIPE_THRESHOLD, TIMING_MS, DEFAULT_THEME, TYPE_ICONS } from "../constants.js";
|
|
9
|
+
import { scheduleOnRN } from 'react-native-worklets';
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const EASE_OUT = Easing.out(Easing.cubic);
|
|
12
|
+
const EASE_IN = Easing.in(Easing.cubic);
|
|
13
|
+
const EASE_REORDER = Easing.out(Easing.exp);
|
|
14
|
+
const ENTER = {
|
|
15
|
+
duration: TIMING_MS,
|
|
16
|
+
easing: EASE_OUT
|
|
17
|
+
};
|
|
18
|
+
const EXIT = {
|
|
19
|
+
duration: TIMING_MS,
|
|
20
|
+
easing: EASE_IN
|
|
21
|
+
};
|
|
22
|
+
const SNAP = {
|
|
23
|
+
duration: 200,
|
|
24
|
+
easing: EASE_OUT
|
|
25
|
+
};
|
|
26
|
+
const ORDER = {
|
|
27
|
+
duration: TIMING_MS,
|
|
28
|
+
easing: EASE_REORDER
|
|
29
|
+
};
|
|
30
|
+
function Spinner({
|
|
31
|
+
color
|
|
32
|
+
}) {
|
|
33
|
+
const rotation = useSharedValue(0);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
rotation.value = withRepeat(withTiming(360, {
|
|
36
|
+
duration: 900,
|
|
37
|
+
easing: Easing.linear
|
|
38
|
+
}), -1, false);
|
|
39
|
+
return () => cancelAnimation(rotation);
|
|
40
|
+
}, [rotation]);
|
|
41
|
+
const spinStyle = useAnimatedStyle(() => ({
|
|
42
|
+
transform: [{
|
|
43
|
+
rotate: `${rotation.value}deg`
|
|
44
|
+
}]
|
|
45
|
+
}));
|
|
46
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
47
|
+
style: [styles.spinnerRing, {
|
|
48
|
+
borderTopColor: color
|
|
49
|
+
}, spinStyle]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export const SignalItem = ({
|
|
53
|
+
signal,
|
|
54
|
+
onHide,
|
|
55
|
+
index,
|
|
56
|
+
maxVisible,
|
|
57
|
+
theme
|
|
58
|
+
}) => {
|
|
59
|
+
const insets = useSafeAreaInsets();
|
|
60
|
+
const isDismissed = useRef(false);
|
|
61
|
+
const timerRef = useRef(null);
|
|
62
|
+
const onHideRef = useRef(onHide);
|
|
63
|
+
const signalRef = useRef(signal);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
onHideRef.current = onHide;
|
|
66
|
+
signalRef.current = signal;
|
|
67
|
+
});
|
|
68
|
+
const isTop = (signal.position ?? 'top') === 'top';
|
|
69
|
+
const swipeable = signal.swipeToDismiss ?? true;
|
|
70
|
+
const autoHide = signal.autoHide ?? true;
|
|
71
|
+
const isLoading = signal.type === 'loading';
|
|
72
|
+
const stackShift = Math.min(index * STACK_OFFSET, Math.max(0, (isTop ? insets.top : insets.bottom) - 8));
|
|
73
|
+
const targetY = isTop ? -stackShift : stackShift;
|
|
74
|
+
const entryY = isTop ? -(ENTRY_OFFSET_Y + Math.abs(targetY)) : ENTRY_OFFSET_Y + Math.abs(targetY);
|
|
75
|
+
const translateY = useSharedValue(entryY);
|
|
76
|
+
const translateX = useSharedValue(0);
|
|
77
|
+
const scale = useSharedValue(1 - index * SCALE_STEP);
|
|
78
|
+
const opacity = useSharedValue(0);
|
|
79
|
+
const progress = useSharedValue(1);
|
|
80
|
+
const handleOnShow = useCallback(() => {
|
|
81
|
+
const s = signalRef.current;
|
|
82
|
+
s.onShow?.();
|
|
83
|
+
const a11y = s.title ? `${s.title}. ${s.description}` : s.description;
|
|
84
|
+
AccessibilityInfo.announceForAccessibility(a11y);
|
|
85
|
+
}, []);
|
|
86
|
+
const handleOnHide = useCallback(() => {
|
|
87
|
+
signalRef.current.onHide?.();
|
|
88
|
+
onHideRef.current();
|
|
89
|
+
}, []);
|
|
90
|
+
const clearTimer = useCallback(() => {
|
|
91
|
+
if (timerRef.current) {
|
|
92
|
+
clearTimeout(timerRef.current);
|
|
93
|
+
timerRef.current = null;
|
|
94
|
+
}
|
|
95
|
+
}, []);
|
|
96
|
+
const dismissRef = useRef(() => {});
|
|
97
|
+
const startTimer = useCallback(() => {
|
|
98
|
+
if (!autoHide || isDismissed.current || timerRef.current) return;
|
|
99
|
+
const duration = signalRef.current.duration ?? 3000;
|
|
100
|
+
progress.value = withTiming(0, {
|
|
101
|
+
duration,
|
|
102
|
+
easing: Easing.linear
|
|
103
|
+
});
|
|
104
|
+
timerRef.current = setTimeout(() => dismissRef.current(), duration);
|
|
105
|
+
}, [autoHide, progress]);
|
|
106
|
+
const dismiss = useCallback(() => {
|
|
107
|
+
if (isDismissed.current) return;
|
|
108
|
+
isDismissed.current = true;
|
|
109
|
+
clearTimer();
|
|
110
|
+
cancelAnimation(translateY);
|
|
111
|
+
cancelAnimation(translateX);
|
|
112
|
+
cancelAnimation(scale);
|
|
113
|
+
cancelAnimation(opacity);
|
|
114
|
+
cancelAnimation(progress);
|
|
115
|
+
translateY.value = withTiming(entryY, EXIT);
|
|
116
|
+
opacity.value = withTiming(0, EXIT, () => {
|
|
117
|
+
'worklet';
|
|
118
|
+
|
|
119
|
+
scheduleOnRN(handleOnHide);
|
|
120
|
+
});
|
|
121
|
+
}, [entryY, clearTimer, handleOnHide, opacity, translateX, translateY, scale, progress]);
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
dismissRef.current = dismiss;
|
|
124
|
+
}, [dismiss]);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
opacity.value = withTiming(1, ENTER);
|
|
127
|
+
translateY.value = withTiming(targetY, ENTER);
|
|
128
|
+
scale.value = withTiming(1 - index * SCALE_STEP, ORDER, finished => {
|
|
129
|
+
'worklet';
|
|
130
|
+
|
|
131
|
+
if (finished) {
|
|
132
|
+
scheduleOnRN(handleOnShow);
|
|
133
|
+
scheduleOnRN(startTimer);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return clearTimer;
|
|
137
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
138
|
+
}, []);
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
if (isDismissed.current) return;
|
|
141
|
+
cancelAnimation(translateY);
|
|
142
|
+
cancelAnimation(scale);
|
|
143
|
+
if (index < maxVisible) {
|
|
144
|
+
if (opacity.value === 0) opacity.value = withTiming(1, ENTER);
|
|
145
|
+
translateY.value = withTiming(targetY, ORDER);
|
|
146
|
+
scale.value = withTiming(1 - index * SCALE_STEP, ORDER, finished => {
|
|
147
|
+
'worklet';
|
|
148
|
+
|
|
149
|
+
if (finished) scheduleOnRN(startTimer);
|
|
150
|
+
});
|
|
151
|
+
} else {
|
|
152
|
+
// Behind the maxVisible cap — hide instantly, no ghost frames
|
|
153
|
+
opacity.value = 0;
|
|
154
|
+
translateY.value = targetY;
|
|
155
|
+
scale.value = 1 - index * SCALE_STEP;
|
|
156
|
+
}
|
|
157
|
+
}, [index]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
158
|
+
|
|
159
|
+
// ─── Handle in-place updates (e.g. loading → success/error) ─────────────
|
|
160
|
+
const prevType = useRef(signal.type);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (isDismissed.current || signal.type === prevType.current) return;
|
|
163
|
+
prevType.current = signal.type;
|
|
164
|
+
|
|
165
|
+
// Reset timer state so the new type's duration applies cleanly
|
|
166
|
+
clearTimer();
|
|
167
|
+
timerRef.current = null;
|
|
168
|
+
isDismissed.current = false;
|
|
169
|
+
|
|
170
|
+
// Brief scale pulse to draw attention to the type change
|
|
171
|
+
cancelAnimation(scale);
|
|
172
|
+
scale.value = withTiming((1 - index * SCALE_STEP) * 1.05, {
|
|
173
|
+
duration: 120,
|
|
174
|
+
easing: EASE_OUT
|
|
175
|
+
}, () => {
|
|
176
|
+
'worklet';
|
|
177
|
+
|
|
178
|
+
scale.value = withTiming(1 - index * SCALE_STEP, {
|
|
179
|
+
duration: 200,
|
|
180
|
+
easing: EASE_OUT
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// Reset progress bar and restart countdown
|
|
185
|
+
progress.value = 1;
|
|
186
|
+
scheduleOnRN(startTimer);
|
|
187
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
188
|
+
}, [signal.type]);
|
|
189
|
+
const pan = Gesture.Pan().enabled(swipeable).onBegin(() => {
|
|
190
|
+
'worklet';
|
|
191
|
+
|
|
192
|
+
cancelAnimation(progress);
|
|
193
|
+
scheduleOnRN(clearTimer);
|
|
194
|
+
}).onUpdate(e => {
|
|
195
|
+
'worklet';
|
|
196
|
+
|
|
197
|
+
translateX.value = e.translationX;
|
|
198
|
+
// Subtle Y resistance — nudges but stays in its lane
|
|
199
|
+
const drag = e.translationY * 0.08;
|
|
200
|
+
translateY.value = targetY + (isTop ? Math.min(0, drag) : Math.max(0, drag));
|
|
201
|
+
}).onEnd(e => {
|
|
202
|
+
'worklet';
|
|
203
|
+
|
|
204
|
+
const flick = Math.abs(e.velocityX) > 600;
|
|
205
|
+
if (Math.abs(e.translationX) > SWIPE_THRESHOLD || flick) {
|
|
206
|
+
cancelAnimation(opacity);
|
|
207
|
+
opacity.value = withTiming(0, EXIT);
|
|
208
|
+
translateX.value = withTiming(e.translationX > 0 ? 600 : -600, EXIT, () => {
|
|
209
|
+
'worklet';
|
|
210
|
+
|
|
211
|
+
scheduleOnRN(handleOnHide);
|
|
212
|
+
});
|
|
213
|
+
} else {
|
|
214
|
+
translateX.value = withTiming(0, SNAP);
|
|
215
|
+
translateY.value = withTiming(targetY, SNAP);
|
|
216
|
+
scheduleOnRN(startTimer);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
const stackOpacity = useDerivedValue(() => {
|
|
220
|
+
'worklet';
|
|
221
|
+
|
|
222
|
+
if (index >= maxVisible) return 0;
|
|
223
|
+
return opacity.value * Math.max(0.6, 1 - index * 0.12);
|
|
224
|
+
});
|
|
225
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
226
|
+
transform: [{
|
|
227
|
+
translateY: translateY.value
|
|
228
|
+
}, {
|
|
229
|
+
translateX: translateX.value
|
|
230
|
+
}, {
|
|
231
|
+
scale: scale.value
|
|
232
|
+
}],
|
|
233
|
+
opacity: stackOpacity.value,
|
|
234
|
+
zIndex: 1000 - index
|
|
235
|
+
}));
|
|
236
|
+
const progressStyle = useAnimatedStyle(() => ({
|
|
237
|
+
width: `${progress.value * 100}%`
|
|
238
|
+
}));
|
|
239
|
+
const type = signal.type ?? 'info';
|
|
240
|
+
const mergedTheme = {
|
|
241
|
+
...DEFAULT_THEME,
|
|
242
|
+
...theme
|
|
243
|
+
};
|
|
244
|
+
// Safe fallback: loading/custom always resolve; unknown type → info
|
|
245
|
+
const typeTheme = mergedTheme[type] ?? mergedTheme.info;
|
|
246
|
+
const iconChar = TYPE_ICONS[type];
|
|
247
|
+
const renderIcon = () => {
|
|
248
|
+
// 1. Caller-supplied ReactNode
|
|
249
|
+
if (signal.icon) {
|
|
250
|
+
return /*#__PURE__*/_jsx(View, {
|
|
251
|
+
style: styles.iconWrap,
|
|
252
|
+
children: signal.icon
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
// 2. Animated spinner for loading
|
|
256
|
+
if (isLoading) {
|
|
257
|
+
return /*#__PURE__*/_jsx(View, {
|
|
258
|
+
style: styles.iconWrap,
|
|
259
|
+
children: /*#__PURE__*/_jsx(Spinner, {
|
|
260
|
+
color: typeTheme.iconColor
|
|
261
|
+
})
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
// 3. Unicode badge for all other types
|
|
265
|
+
if (iconChar) {
|
|
266
|
+
return /*#__PURE__*/_jsx(View, {
|
|
267
|
+
style: [styles.iconWrap, styles.iconBadge, {
|
|
268
|
+
borderColor: typeTheme.iconColor
|
|
269
|
+
}],
|
|
270
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
271
|
+
style: [styles.iconText, {
|
|
272
|
+
color: typeTheme.iconColor
|
|
273
|
+
}],
|
|
274
|
+
children: iconChar
|
|
275
|
+
})
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
};
|
|
280
|
+
return /*#__PURE__*/_jsx(GestureDetector, {
|
|
281
|
+
gesture: pan,
|
|
282
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
283
|
+
style: [styles.container, isTop ? styles.anchorTop : styles.anchorBottom, animatedStyle],
|
|
284
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
285
|
+
accessible: true,
|
|
286
|
+
accessibilityRole: "alert",
|
|
287
|
+
accessibilityLiveRegion: type === 'error' ? 'assertive' : 'polite',
|
|
288
|
+
accessibilityLabel: signal.title ? `${signal.title}. ${signal.description}` : signal.description,
|
|
289
|
+
accessibilityHint: swipeable ? 'Swipe to dismiss or tap to interact' : 'Tap to interact',
|
|
290
|
+
onPress: () => signalRef.current.onPress?.(dismiss),
|
|
291
|
+
style: ({
|
|
292
|
+
pressed
|
|
293
|
+
}) => pressed && styles.pressed,
|
|
294
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
295
|
+
style: [styles.box, {
|
|
296
|
+
backgroundColor: typeTheme.background,
|
|
297
|
+
borderColor: typeTheme.border
|
|
298
|
+
}],
|
|
299
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
300
|
+
style: styles.row,
|
|
301
|
+
children: [renderIcon(), /*#__PURE__*/_jsxs(View, {
|
|
302
|
+
style: styles.content,
|
|
303
|
+
children: [signal.title ? /*#__PURE__*/_jsx(Text, {
|
|
304
|
+
style: [styles.title, {
|
|
305
|
+
color: typeTheme.titleColor
|
|
306
|
+
}],
|
|
307
|
+
numberOfLines: 1,
|
|
308
|
+
children: signal.title
|
|
309
|
+
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
310
|
+
style: [styles.description, {
|
|
311
|
+
color: typeTheme.descriptionColor
|
|
312
|
+
}],
|
|
313
|
+
numberOfLines: 3,
|
|
314
|
+
children: signal.description
|
|
315
|
+
})]
|
|
316
|
+
}), swipeable && /*#__PURE__*/_jsx(Pressable, {
|
|
317
|
+
onPress: dismiss,
|
|
318
|
+
hitSlop: 12,
|
|
319
|
+
accessibilityLabel: "Dismiss",
|
|
320
|
+
accessibilityRole: "button",
|
|
321
|
+
style: styles.closeBtn,
|
|
322
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
323
|
+
style: styles.closeIcon,
|
|
324
|
+
children: "\u2715"
|
|
325
|
+
})
|
|
326
|
+
})]
|
|
327
|
+
}), signal.action ? /*#__PURE__*/_jsx(View, {
|
|
328
|
+
style: styles.actionRow,
|
|
329
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
330
|
+
onPress: () => signal.action.onPress(dismiss),
|
|
331
|
+
style: ({
|
|
332
|
+
pressed
|
|
333
|
+
}) => [styles.actionBtn, {
|
|
334
|
+
borderColor: typeTheme.iconColor + '50'
|
|
335
|
+
}, pressed && styles.actionPressed],
|
|
336
|
+
accessibilityRole: "button",
|
|
337
|
+
accessibilityLabel: signal.action.label,
|
|
338
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
339
|
+
style: [styles.actionLabel, {
|
|
340
|
+
color: typeTheme.iconColor
|
|
341
|
+
}],
|
|
342
|
+
children: signal.action.label
|
|
343
|
+
})
|
|
344
|
+
})
|
|
345
|
+
}) : null, autoHide ? /*#__PURE__*/_jsx(View, {
|
|
346
|
+
style: styles.progressTrack,
|
|
347
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
348
|
+
style: [styles.progressFill, {
|
|
349
|
+
backgroundColor: typeTheme.iconColor
|
|
350
|
+
}, progressStyle]
|
|
351
|
+
})
|
|
352
|
+
}) : null]
|
|
353
|
+
})
|
|
354
|
+
})
|
|
355
|
+
})
|
|
356
|
+
});
|
|
357
|
+
};
|
|
358
|
+
const styles = StyleSheet.create({
|
|
359
|
+
container: {
|
|
360
|
+
position: 'absolute',
|
|
361
|
+
left: 16,
|
|
362
|
+
right: 16
|
|
363
|
+
},
|
|
364
|
+
anchorTop: {
|
|
365
|
+
top: 0
|
|
366
|
+
},
|
|
367
|
+
anchorBottom: {
|
|
368
|
+
bottom: 0
|
|
369
|
+
},
|
|
370
|
+
box: {
|
|
371
|
+
borderRadius: 16,
|
|
372
|
+
paddingTop: 12,
|
|
373
|
+
paddingBottom: 10,
|
|
374
|
+
paddingHorizontal: 14,
|
|
375
|
+
marginBottom: 8,
|
|
376
|
+
borderWidth: 1,
|
|
377
|
+
overflow: 'hidden',
|
|
378
|
+
// clips progress bar to card radius
|
|
379
|
+
...Platform.select({
|
|
380
|
+
ios: {
|
|
381
|
+
shadowColor: '#000',
|
|
382
|
+
shadowOffset: {
|
|
383
|
+
width: 0,
|
|
384
|
+
height: 6
|
|
385
|
+
},
|
|
386
|
+
shadowOpacity: 0.35,
|
|
387
|
+
shadowRadius: 10
|
|
388
|
+
},
|
|
389
|
+
android: {
|
|
390
|
+
elevation: 10
|
|
391
|
+
}
|
|
392
|
+
})
|
|
393
|
+
},
|
|
394
|
+
row: {
|
|
395
|
+
flexDirection: 'row',
|
|
396
|
+
alignItems: 'center',
|
|
397
|
+
gap: 10
|
|
398
|
+
},
|
|
399
|
+
// Icon container (shared by badge, spinner, custom)
|
|
400
|
+
iconWrap: {
|
|
401
|
+
width: 28,
|
|
402
|
+
height: 28,
|
|
403
|
+
borderRadius: 14,
|
|
404
|
+
alignItems: 'center',
|
|
405
|
+
justifyContent: 'center',
|
|
406
|
+
flexShrink: 0
|
|
407
|
+
},
|
|
408
|
+
// Extra style for the bordered unicode badge variant
|
|
409
|
+
iconBadge: {
|
|
410
|
+
borderWidth: 1.5
|
|
411
|
+
},
|
|
412
|
+
iconText: {
|
|
413
|
+
fontSize: 12,
|
|
414
|
+
fontWeight: '700'
|
|
415
|
+
},
|
|
416
|
+
// Spinner: 3 transparent sides + 1 colored = arc effect
|
|
417
|
+
spinnerRing: {
|
|
418
|
+
width: 20,
|
|
419
|
+
height: 20,
|
|
420
|
+
borderRadius: 10,
|
|
421
|
+
borderWidth: 2.5,
|
|
422
|
+
borderColor: 'transparent'
|
|
423
|
+
// borderTopColor set via inline style
|
|
424
|
+
},
|
|
425
|
+
content: {
|
|
426
|
+
flex: 1
|
|
427
|
+
},
|
|
428
|
+
title: {
|
|
429
|
+
fontWeight: '600',
|
|
430
|
+
fontSize: 14,
|
|
431
|
+
marginBottom: 2
|
|
432
|
+
},
|
|
433
|
+
description: {
|
|
434
|
+
fontSize: 13,
|
|
435
|
+
lineHeight: 18
|
|
436
|
+
},
|
|
437
|
+
closeBtn: {
|
|
438
|
+
padding: 2,
|
|
439
|
+
flexShrink: 0
|
|
440
|
+
},
|
|
441
|
+
closeIcon: {
|
|
442
|
+
color: '#ffffff60',
|
|
443
|
+
fontSize: 12,
|
|
444
|
+
fontWeight: '700'
|
|
445
|
+
},
|
|
446
|
+
pressed: {
|
|
447
|
+
opacity: 0.85
|
|
448
|
+
},
|
|
449
|
+
// Action button
|
|
450
|
+
actionRow: {
|
|
451
|
+
marginTop: 10,
|
|
452
|
+
alignItems: 'flex-start'
|
|
453
|
+
},
|
|
454
|
+
actionBtn: {
|
|
455
|
+
paddingVertical: 5,
|
|
456
|
+
paddingHorizontal: 12,
|
|
457
|
+
borderRadius: 8,
|
|
458
|
+
borderWidth: 1
|
|
459
|
+
},
|
|
460
|
+
actionPressed: {
|
|
461
|
+
opacity: 0.65
|
|
462
|
+
},
|
|
463
|
+
actionLabel: {
|
|
464
|
+
fontSize: 12,
|
|
465
|
+
fontWeight: '700',
|
|
466
|
+
letterSpacing: 0.2
|
|
467
|
+
},
|
|
468
|
+
// Progress bar
|
|
469
|
+
progressTrack: {
|
|
470
|
+
marginTop: 10,
|
|
471
|
+
height: 2,
|
|
472
|
+
borderRadius: 1,
|
|
473
|
+
backgroundColor: '#ffffff14',
|
|
474
|
+
overflow: 'hidden'
|
|
475
|
+
},
|
|
476
|
+
progressFill: {
|
|
477
|
+
height: '100%',
|
|
478
|
+
borderRadius: 1,
|
|
479
|
+
opacity: 0.6
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
//# sourceMappingURL=signal-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useRef","Text","StyleSheet","View","Pressable","AccessibilityInfo","Platform","Animated","useSharedValue","useAnimatedStyle","withTiming","withRepeat","useDerivedValue","cancelAnimation","Easing","Gesture","GestureDetector","useSafeAreaInsets","ENTRY_OFFSET_Y","SCALE_STEP","STACK_OFFSET","SWIPE_THRESHOLD","TIMING_MS","DEFAULT_THEME","TYPE_ICONS","scheduleOnRN","jsx","_jsx","jsxs","_jsxs","EASE_OUT","out","cubic","EASE_IN","in","EASE_REORDER","exp","ENTER","duration","easing","EXIT","SNAP","ORDER","Spinner","color","rotation","value","linear","spinStyle","transform","rotate","style","styles","spinnerRing","borderTopColor","SignalItem","signal","onHide","index","maxVisible","theme","insets","isDismissed","timerRef","onHideRef","signalRef","current","isTop","position","swipeable","swipeToDismiss","autoHide","isLoading","type","stackShift","Math","min","max","top","bottom","targetY","entryY","abs","translateY","translateX","scale","opacity","progress","handleOnShow","s","onShow","a11y","title","description","announceForAccessibility","handleOnHide","clearTimer","clearTimeout","dismissRef","startTimer","setTimeout","dismiss","finished","prevType","pan","Pan","enabled","onBegin","onUpdate","e","translationX","drag","translationY","onEnd","flick","velocityX","stackOpacity","animatedStyle","zIndex","progressStyle","width","mergedTheme","typeTheme","info","iconChar","renderIcon","icon","iconWrap","children","iconColor","iconBadge","borderColor","iconText","gesture","container","anchorTop","anchorBottom","accessible","accessibilityRole","accessibilityLiveRegion","accessibilityLabel","accessibilityHint","onPress","pressed","box","backgroundColor","background","border","row","content","titleColor","numberOfLines","descriptionColor","hitSlop","closeBtn","closeIcon","action","actionRow","actionBtn","actionPressed","label","actionLabel","progressTrack","progressFill","create","left","right","borderRadius","paddingTop","paddingBottom","paddingHorizontal","marginBottom","borderWidth","overflow","select","ios","shadowColor","shadowOffset","height","shadowOpacity","shadowRadius","android","elevation","flexDirection","alignItems","gap","justifyContent","flexShrink","fontSize","fontWeight","flex","lineHeight","padding","marginTop","paddingVertical","letterSpacing"],"sourceRoot":"../../../src","sources":["components/signal-item.tsx"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACtD,SACEC,IAAI,EACJC,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,iBAAiB,EACjBC,QAAQ,QACH,cAAc;AACrB,OAAOC,QAAQ,IACbC,cAAc,EACdC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,eAAe,EACfC,eAAe,EACfC,MAAM,QACD,yBAAyB;AAChC,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SACEC,cAAc,EACdC,UAAU,EACVC,YAAY,EACZC,eAAe,EACfC,SAAS,EACTC,aAAa,EACbC,UAAU,QACL,iBAAc;AAErB,SAASC,YAAY,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErD,MAAMC,QAAQ,GAAGhB,MAAM,CAACiB,GAAG,CAACjB,MAAM,CAACkB,KAAK,CAAC;AACzC,MAAMC,OAAO,GAAGnB,MAAM,CAACoB,EAAE,CAACpB,MAAM,CAACkB,KAAK,CAAC;AACvC,MAAMG,YAAY,GAAGrB,MAAM,CAACiB,GAAG,CAACjB,MAAM,CAACsB,GAAG,CAAC;AAE3C,MAAMC,KAAK,GAAG;EAAEC,QAAQ,EAAEhB,SAA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Q,EAAE,EAAE;IAAEC,UAAU,EAAE;EAAM,CAAC;EAElE9C,OAAO,EAAE;IAAEzD,OAAO,EAAE;EAAK,CAAC;EAE1B;EACAuE,SAAS,EAAE;IACToC,SAAS,EAAE,EAAE;IACbT,UAAU,EAAE;EACd,CAAC;EACD1B,SAAS,EAAE;IACToC,eAAe,EAAE,CAAC;IAClBxB,iBAAiB,EAAE,EAAE;IACrBH,YAAY,EAAE,CAAC;IACfK,WAAW,EAAE;EACf,CAAC;EACDb,aAAa,EAAE;IAAEzE,OAAO,EAAE;EAAK,CAAC;EAChC2E,WAAW,EAAE;IACX2B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBM,aAAa,EAAE;EACjB,CAAC;EAED;EACAjC,aAAa,EAAE;IACb+B,SAAS,EAAE,EAAE;IACbf,MAAM,EAAE,CAAC;IACTX,YAAY,EAAE,CAAC;IACftB,eAAe,EAAE,WAAW;IAC5B4B,QAAQ,EAAE;EACZ,CAAC;EACDV,YAAY,EAAE;IACZe,MAAM,EAAE,MAAM;IACdX,YAAY,EAAE,CAAC;IACfjF,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const MAX_VISIBLE = 3;
|
|
4
|
+
export const DEFAULT_DURATION = 3000;
|
|
5
|
+
export const STACK_OFFSET = 14;
|
|
6
|
+
export const SCALE_STEP = 0.05;
|
|
7
|
+
export const ENTRY_OFFSET_Y = 80;
|
|
8
|
+
export const SWIPE_THRESHOLD = 100;
|
|
9
|
+
export const TIMING_MS = 280;
|
|
10
|
+
export const DEFAULT_THEME = {
|
|
11
|
+
success: {
|
|
12
|
+
background: '#0a0a0a',
|
|
13
|
+
border: '#22c55e40',
|
|
14
|
+
titleColor: '#ffffff',
|
|
15
|
+
descriptionColor: '#d1fae5',
|
|
16
|
+
iconColor: '#22c55e'
|
|
17
|
+
},
|
|
18
|
+
error: {
|
|
19
|
+
background: '#0a0a0a',
|
|
20
|
+
border: '#ef444440',
|
|
21
|
+
titleColor: '#ffffff',
|
|
22
|
+
descriptionColor: '#fee2e2',
|
|
23
|
+
iconColor: '#ef4444'
|
|
24
|
+
},
|
|
25
|
+
warning: {
|
|
26
|
+
background: '#0a0a0a',
|
|
27
|
+
border: '#f59e0b40',
|
|
28
|
+
titleColor: '#ffffff',
|
|
29
|
+
descriptionColor: '#fef3c7',
|
|
30
|
+
iconColor: '#f59e0b'
|
|
31
|
+
},
|
|
32
|
+
info: {
|
|
33
|
+
background: '#0a0a0a',
|
|
34
|
+
border: '#ffffff26',
|
|
35
|
+
titleColor: '#ffffff',
|
|
36
|
+
descriptionColor: '#ffffffcc',
|
|
37
|
+
iconColor: '#60a5fa'
|
|
38
|
+
},
|
|
39
|
+
loading: {
|
|
40
|
+
background: '#0a0a0a',
|
|
41
|
+
border: '#a78bfa40',
|
|
42
|
+
titleColor: '#ffffff',
|
|
43
|
+
descriptionColor: '#ede9fe',
|
|
44
|
+
iconColor: '#a78bfa'
|
|
45
|
+
},
|
|
46
|
+
custom: {
|
|
47
|
+
background: '#0a0a0a',
|
|
48
|
+
border: '#ffffff26',
|
|
49
|
+
titleColor: '#ffffff',
|
|
50
|
+
descriptionColor: '#ffffffcc',
|
|
51
|
+
iconColor: '#ffffff'
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** Unicode icons for non-loading, non-custom types */
|
|
56
|
+
export const TYPE_ICONS = {
|
|
57
|
+
success: '✓',
|
|
58
|
+
error: '✕',
|
|
59
|
+
warning: '⚠',
|
|
60
|
+
info: 'ℹ'
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MAX_VISIBLE","DEFAULT_DURATION","STACK_OFFSET","SCALE_STEP","ENTRY_OFFSET_Y","SWIPE_THRESHOLD","TIMING_MS","DEFAULT_THEME","success","background","border","titleColor","descriptionColor","iconColor","error","warning","info","loading","custom","TYPE_ICONS"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":";;AAEA,OAAO,MAAMA,WAAW,GAAG,CAAC;AAC5B,OAAO,MAAMC,gBAAgB,GAAG,IAAI;AACpC,OAAO,MAAMC,YAAY,GAAG,EAAE;AAC9B,OAAO,MAAMC,UAAU,GAAG,IAAI;AAC9B,OAAO,MAAMC,cAAc,GAAG,EAAE;AAChC,OAAO,MAAMC,eAAe,GAAG,GAAG;AAClC,OAAO,MAAMC,SAAS,GAAG,GAAG;AAE5B,OAAO,MAAMC,aAA0B,GAAG;EACxCC,OAAO,EAAE;IACPC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE,WAAW;IACnBC,UAAU,EAAE,SAAS;IACrBC,gBAAgB,EAAE,SAAS;IAC3BC,SAAS,EAAE;EACb,CAAC;EACDC,KAAK,EAAE;IACLL,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE,WAAW;IACnBC,UAAU,EAAE,SAAS;IACrBC,gBAAgB,EAAE,SAAS;IAC3BC,SAAS,EAAE;EACb,CAAC;EACDE,OAAO,EAAE;IACPN,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE,WAAW;IACnBC,UAAU,EAAE,SAAS;IACrBC,gBAAgB,EAAE,SAAS;IAC3BC,SAAS,EAAE;EACb,CAAC;EACDG,IAAI,EAAE;IACJP,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE,WAAW;IACnBC,UAAU,EAAE,SAAS;IACrBC,gBAAgB,EAAE,WAAW;IAC7BC,SAAS,EAAE;EACb,CAAC;EACDI,OAAO,EAAE;IACPR,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE,WAAW;IACnBC,UAAU,EAAE,SAAS;IACrBC,gBAAgB,EAAE,SAAS;IAC3BC,SAAS,EAAE;EACb,CAAC;EACDK,MAAM,EAAE;IACNT,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE,WAAW;IACnBC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