@umituz/react-native-design-system 2.6.47 → 2.6.49
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/package.json +1 -1
- package/src/atoms/skeleton/AtomicSkeleton.tsx +16 -62
- package/src/index.ts +0 -32
- package/src/molecules/bottom-sheet/components/BottomSheetModal.tsx +101 -180
- package/src/molecules/bottom-sheet/components/SafeBottomSheetModalProvider.tsx +8 -14
- package/src/molecules/index.ts +0 -6
- package/src/molecules/animation/core/AnimationCore.ts +0 -29
- package/src/molecules/animation/domain/entities/Animation.ts +0 -81
- package/src/molecules/animation/domain/entities/Fireworks.ts +0 -44
- package/src/molecules/animation/domain/entities/Theme.ts +0 -76
- package/src/molecules/animation/index.ts +0 -146
- package/src/molecules/animation/infrastructure/services/AnimationConfigService.ts +0 -35
- package/src/molecules/animation/infrastructure/services/SpringAnimationConfigService.ts +0 -67
- package/src/molecules/animation/infrastructure/services/TimingAnimationConfigService.ts +0 -57
- package/src/molecules/animation/infrastructure/services/__tests__/SpringAnimationConfigService.test.ts +0 -114
- package/src/molecules/animation/infrastructure/services/__tests__/TimingAnimationConfigService.test.ts +0 -105
- package/src/molecules/animation/presentation/components/Fireworks.tsx +0 -127
- package/src/molecules/animation/presentation/components/__tests__/Fireworks.test.tsx +0 -185
- package/src/molecules/animation/presentation/hooks/__tests__/useAnimation.integration.test.ts +0 -210
- package/src/molecules/animation/presentation/hooks/__tests__/useFireworks.test.ts +0 -242
- package/src/molecules/animation/presentation/hooks/__tests__/useGesture.test.ts +0 -108
- package/src/molecules/animation/presentation/hooks/__tests__/useSpringAnimation.test.ts +0 -127
- package/src/molecules/animation/presentation/hooks/__tests__/useTimingAnimation.test.ts +0 -172
- package/src/molecules/animation/presentation/hooks/__tests__/useTransformAnimation.test.ts +0 -133
- package/src/molecules/animation/presentation/hooks/useAnimation.ts +0 -77
- package/src/molecules/animation/presentation/hooks/useFireworks.ts +0 -144
- package/src/molecules/animation/presentation/hooks/useGesture.ts +0 -57
- package/src/molecules/animation/presentation/hooks/useGestureCreators.ts +0 -163
- package/src/molecules/animation/presentation/hooks/useGestureState.ts +0 -53
- package/src/molecules/animation/presentation/hooks/useIconAnimations.ts +0 -120
- package/src/molecules/animation/presentation/hooks/useModalAnimations.ts +0 -124
- package/src/molecules/animation/presentation/hooks/useReanimatedReady.ts +0 -60
- package/src/molecules/animation/presentation/hooks/useSpringAnimation.ts +0 -69
- package/src/molecules/animation/presentation/hooks/useTimingAnimation.ts +0 -111
- package/src/molecules/animation/presentation/hooks/useTransformAnimation.ts +0 -57
- package/src/molecules/animation/presentation/providers/AnimationThemeProvider.tsx +0 -60
- package/src/molecules/animation/presentation/providers/__tests__/AnimationThemeProvider.test.tsx +0 -165
- package/src/molecules/celebration/domain/entities/CelebrationConfig.ts +0 -17
- package/src/molecules/celebration/domain/entities/FireworksConfig.ts +0 -32
- package/src/molecules/celebration/index.ts +0 -93
- package/src/molecules/celebration/infrastructure/services/FireworksConfigService.ts +0 -49
- package/src/molecules/celebration/presentation/components/CelebrationFireworksOverlay.tsx +0 -33
- package/src/molecules/celebration/presentation/components/CelebrationModal.tsx +0 -81
- package/src/molecules/celebration/presentation/components/CelebrationModalContent.tsx +0 -88
- package/src/molecules/celebration/presentation/hooks/useCelebrationModalAnimation.ts +0 -49
- package/src/molecules/celebration/presentation/hooks/useCelebrationState.ts +0 -45
- package/src/molecules/celebration/presentation/styles/CelebrationModalStyles.ts +0 -65
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.49",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AtomicSkeleton - Skeleton Loader Component
|
|
3
3
|
*
|
|
4
|
-
* Skeleton placeholder loader
|
|
4
|
+
* Skeleton placeholder loader for loading states.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```tsx
|
|
@@ -22,24 +22,12 @@
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import React
|
|
26
|
-
import { View, StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
|
|
27
|
-
import Animated, {
|
|
28
|
-
useSharedValue,
|
|
29
|
-
useAnimatedStyle,
|
|
30
|
-
withRepeat,
|
|
31
|
-
withSequence,
|
|
32
|
-
withTiming,
|
|
33
|
-
Easing,
|
|
34
|
-
} from 'react-native-reanimated';
|
|
25
|
+
import React from 'react';
|
|
26
|
+
import { View, StyleSheet, type StyleProp, type ViewStyle, type DimensionValue } from 'react-native';
|
|
35
27
|
import { useAppDesignTokens } from '../../theme';
|
|
36
28
|
import type { SkeletonPattern, SkeletonConfig } from './AtomicSkeleton.types';
|
|
37
29
|
import { SKELETON_PATTERNS } from './AtomicSkeleton.types';
|
|
38
30
|
|
|
39
|
-
const AnimatedView = (Animated as any).createAnimatedComponent(View);
|
|
40
|
-
|
|
41
|
-
const SHIMMER_DURATION = 1200;
|
|
42
|
-
|
|
43
31
|
export interface AtomicSkeletonProps {
|
|
44
32
|
/** Skeleton pattern preset */
|
|
45
33
|
pattern?: SkeletonPattern;
|
|
@@ -49,63 +37,32 @@ export interface AtomicSkeletonProps {
|
|
|
49
37
|
count?: number;
|
|
50
38
|
/** Custom container style */
|
|
51
39
|
style?: StyleProp<ViewStyle>;
|
|
52
|
-
/** Disable shimmer animation */
|
|
53
|
-
disableAnimation?: boolean;
|
|
54
40
|
/** Test ID for testing */
|
|
55
41
|
testID?: string;
|
|
56
42
|
}
|
|
57
43
|
|
|
58
44
|
/**
|
|
59
|
-
* Skeleton loader component
|
|
45
|
+
* Skeleton loader component
|
|
60
46
|
*
|
|
61
47
|
* Provides visual feedback during content loading with customizable patterns
|
|
62
48
|
*/
|
|
63
49
|
const SkeletonItem: React.FC<{
|
|
64
50
|
config: SkeletonConfig;
|
|
65
51
|
baseColor: string;
|
|
66
|
-
highlightColor: string;
|
|
67
|
-
disableAnimation: boolean;
|
|
68
52
|
multiplier: number;
|
|
69
|
-
}> = ({ config, baseColor,
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-1,
|
|
81
|
-
false
|
|
82
|
-
);
|
|
83
|
-
}, [opacity, disableAnimation]);
|
|
53
|
+
}> = ({ config, baseColor, multiplier }) => {
|
|
54
|
+
const itemStyles = StyleSheet.create({
|
|
55
|
+
item: {
|
|
56
|
+
...styles.skeleton,
|
|
57
|
+
width: (typeof config.width === 'number' ? config.width * multiplier : config.width) as DimensionValue,
|
|
58
|
+
height: config.height ? config.height * multiplier : undefined,
|
|
59
|
+
borderRadius: config.borderRadius ? config.borderRadius * multiplier : undefined,
|
|
60
|
+
marginBottom: config.marginBottom ? config.marginBottom * multiplier : undefined,
|
|
61
|
+
backgroundColor: baseColor,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
84
64
|
|
|
85
|
-
|
|
86
|
-
backgroundColor: disableAnimation
|
|
87
|
-
? baseColor
|
|
88
|
-
: opacity.value === 0
|
|
89
|
-
? baseColor
|
|
90
|
-
: highlightColor,
|
|
91
|
-
opacity: disableAnimation ? 1 : 0.5 + opacity.value * 0.5,
|
|
92
|
-
}));
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<AnimatedView
|
|
96
|
-
style={[
|
|
97
|
-
styles.skeleton,
|
|
98
|
-
{
|
|
99
|
-
width: typeof config.width === 'number' ? config.width * multiplier : config.width,
|
|
100
|
-
height: config.height ? config.height * multiplier : undefined,
|
|
101
|
-
borderRadius: config.borderRadius ? config.borderRadius * multiplier : undefined,
|
|
102
|
-
marginBottom: config.marginBottom ? config.marginBottom * multiplier : undefined,
|
|
103
|
-
backgroundColor: baseColor,
|
|
104
|
-
},
|
|
105
|
-
animatedStyle,
|
|
106
|
-
]}
|
|
107
|
-
/>
|
|
108
|
-
);
|
|
65
|
+
return <View style={itemStyles.item} />;
|
|
109
66
|
};
|
|
110
67
|
|
|
111
68
|
export const AtomicSkeleton: React.FC<AtomicSkeletonProps> = ({
|
|
@@ -113,7 +70,6 @@ export const AtomicSkeleton: React.FC<AtomicSkeletonProps> = ({
|
|
|
113
70
|
custom,
|
|
114
71
|
count = 1,
|
|
115
72
|
style,
|
|
116
|
-
disableAnimation = false,
|
|
117
73
|
testID,
|
|
118
74
|
}) => {
|
|
119
75
|
const tokens = useAppDesignTokens();
|
|
@@ -128,8 +84,6 @@ export const AtomicSkeleton: React.FC<AtomicSkeletonProps> = ({
|
|
|
128
84
|
key={`skeleton-${index}-${configIndex}`}
|
|
129
85
|
config={config}
|
|
130
86
|
baseColor={tokens.colors.surfaceSecondary}
|
|
131
|
-
highlightColor={tokens.colors.border}
|
|
132
|
-
disableAnimation={disableAnimation}
|
|
133
87
|
multiplier={tokens.spacingMultiplier}
|
|
134
88
|
/>
|
|
135
89
|
))}
|
package/src/index.ts
CHANGED
|
@@ -378,24 +378,6 @@ export {
|
|
|
378
378
|
type StackNavigationOptions,
|
|
379
379
|
type TabLabelProps,
|
|
380
380
|
type TabBarConfig,
|
|
381
|
-
// Celebration
|
|
382
|
-
CelebrationModal,
|
|
383
|
-
CelebrationModalContent,
|
|
384
|
-
CelebrationFireworksOverlay,
|
|
385
|
-
useCelebrationState,
|
|
386
|
-
useCelebrationModalAnimation,
|
|
387
|
-
FireworksConfigService,
|
|
388
|
-
DEFAULT_FIREWORKS_COLORS,
|
|
389
|
-
DEFAULT_FIREWORKS_CONFIG,
|
|
390
|
-
type CelebrationConfig,
|
|
391
|
-
type CelebrationAction,
|
|
392
|
-
type ThemeColors,
|
|
393
|
-
type CelebrationFireworksConfig,
|
|
394
|
-
type UseCelebrationStateReturn,
|
|
395
|
-
type UseCelebrationModalAnimationReturn,
|
|
396
|
-
type CelebrationModalProps,
|
|
397
|
-
type CelebrationModalContentProps,
|
|
398
|
-
type CelebrationFireworksOverlayProps,
|
|
399
381
|
// Long Press Menu
|
|
400
382
|
type MenuAction,
|
|
401
383
|
type MenuActionTypeValue,
|
|
@@ -441,20 +423,6 @@ export {
|
|
|
441
423
|
type SplashColors,
|
|
442
424
|
type UseSplashFlowOptions,
|
|
443
425
|
type UseSplashFlowResult,
|
|
444
|
-
// Animation
|
|
445
|
-
Animated,
|
|
446
|
-
useSharedValue,
|
|
447
|
-
useAnimatedStyle,
|
|
448
|
-
withTiming,
|
|
449
|
-
withSpring,
|
|
450
|
-
withSequence,
|
|
451
|
-
withRepeat,
|
|
452
|
-
runOnJS,
|
|
453
|
-
cancelAnimation,
|
|
454
|
-
Easing,
|
|
455
|
-
type SharedValue,
|
|
456
|
-
type WithTimingConfig,
|
|
457
|
-
type WithSpringConfig,
|
|
458
426
|
} from './molecules';
|
|
459
427
|
|
|
460
428
|
// =============================================================================
|
|
@@ -1,192 +1,113 @@
|
|
|
1
|
-
import React, { forwardRef,
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
BottomSheetModal as GorhomBottomSheetModal,
|
|
5
|
-
BottomSheetView,
|
|
6
|
-
BottomSheetBackdrop,
|
|
7
|
-
type BottomSheetBackdropProps,
|
|
8
|
-
} from '@gorhom/bottom-sheet';
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState, useCallback } from 'react';
|
|
2
|
+
import { Modal, View, StyleSheet, Pressable, Platform } from 'react-native';
|
|
9
3
|
import { useAppDesignTokens } from '../../../theme';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
BottomSheetModalProps,
|
|
14
|
-
} from '../types/BottomSheet';
|
|
15
|
-
import { BottomSheetUtils } from '../types/BottomSheet';
|
|
4
|
+
import { useSafeAreaInsets } from '../../../safe-area';
|
|
5
|
+
import { getResponsiveBottomSheetLayout } from '../../../responsive';
|
|
6
|
+
import type { BottomSheetModalRef, BottomSheetModalProps } from '../types/BottomSheet';
|
|
16
7
|
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
children,
|
|
20
|
-
preset = 'medium',
|
|
21
|
-
snapPoints: customSnapPoints,
|
|
22
|
-
initialIndex,
|
|
23
|
-
enableBackdrop = true,
|
|
24
|
-
backdropAppearsOnIndex,
|
|
25
|
-
backdropDisappearsOnIndex,
|
|
26
|
-
keyboardBehavior = 'interactive',
|
|
27
|
-
enableHandleIndicator = true,
|
|
28
|
-
enablePanDownToClose = true,
|
|
29
|
-
enableDynamicSizing = false,
|
|
30
|
-
onChange,
|
|
31
|
-
onDismiss,
|
|
32
|
-
backgroundColor,
|
|
33
|
-
} = props;
|
|
8
|
+
declare const __DEV__: boolean;
|
|
34
9
|
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModalProps>(
|
|
11
|
+
(props, ref) => {
|
|
12
|
+
const {
|
|
13
|
+
children,
|
|
14
|
+
preset = 'medium',
|
|
15
|
+
onDismiss,
|
|
16
|
+
backgroundColor,
|
|
17
|
+
} = props;
|
|
37
18
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
initialIndex,
|
|
43
|
-
enableBackdrop,
|
|
44
|
-
backdropAppearsOnIndex,
|
|
45
|
-
backdropDisappearsOnIndex,
|
|
46
|
-
keyboardBehavior,
|
|
47
|
-
enableHandleIndicator,
|
|
48
|
-
enablePanDownToClose,
|
|
49
|
-
enableDynamicSizing,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return BottomSheetUtils.getPreset(preset);
|
|
53
|
-
}, [preset, customSnapPoints, initialIndex, enableBackdrop, backdropAppearsOnIndex, backdropDisappearsOnIndex, keyboardBehavior, enableHandleIndicator, enablePanDownToClose, enableDynamicSizing]);
|
|
19
|
+
const [visible, setVisible] = useState(false);
|
|
20
|
+
const tokens = useAppDesignTokens();
|
|
21
|
+
const insets = useSafeAreaInsets();
|
|
22
|
+
const { maxHeight, borderRadius } = getResponsiveBottomSheetLayout();
|
|
54
23
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
opacity={0.5}
|
|
63
|
-
pressBehavior="close"
|
|
64
|
-
/>
|
|
65
|
-
) : null,
|
|
66
|
-
[enableBackdrop, config.backdropAppearsOnIndex, config.backdropDisappearsOnIndex]
|
|
67
|
-
);
|
|
24
|
+
const PRESET_HEIGHTS = {
|
|
25
|
+
small: maxHeight * 0.35,
|
|
26
|
+
medium: maxHeight * 0.6,
|
|
27
|
+
large: maxHeight * 0.85,
|
|
28
|
+
full: maxHeight,
|
|
29
|
+
custom: maxHeight * 0.6,
|
|
30
|
+
};
|
|
68
31
|
|
|
69
|
-
|
|
70
|
-
(index: number) => {
|
|
71
|
-
if (__DEV__) {
|
|
72
|
-
console.log('[BottomSheetModal] onChange triggered', { index });
|
|
73
|
-
}
|
|
74
|
-
onChange?.(index);
|
|
75
|
-
if (index === -1) onDismiss?.();
|
|
76
|
-
},
|
|
77
|
-
[onChange, onDismiss]
|
|
78
|
-
);
|
|
32
|
+
const sheetHeight = PRESET_HEIGHTS[preset] || PRESET_HEIGHTS.medium;
|
|
79
33
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
refExists: !!modalRef.current,
|
|
85
|
-
hasPresentMethod: typeof modalRef.current?.present === 'function',
|
|
86
|
-
refType: typeof modalRef.current,
|
|
87
|
-
refKeys: modalRef.current ? Object.keys(modalRef.current) : []
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
try {
|
|
92
|
-
if (!modalRef.current) {
|
|
93
|
-
if (__DEV__) console.error('[BottomSheetModal] modalRef.current is null!');
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (typeof modalRef.current.present !== 'function') {
|
|
98
|
-
if (__DEV__) console.error('[BottomSheetModal] present is not a function!', typeof modalRef.current.present);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (__DEV__) console.log('[BottomSheetModal] Calling modalRef.current.present()...');
|
|
103
|
-
modalRef.current.present();
|
|
104
|
-
if (__DEV__) console.log('[BottomSheetModal] modalRef.current.present() executed');
|
|
105
|
-
|
|
106
|
-
// Fallback: Also try snapToIndex as a workaround
|
|
107
|
-
setTimeout(() => {
|
|
108
|
-
if (modalRef.current && typeof modalRef.current.snapToIndex === 'function') {
|
|
109
|
-
if (__DEV__) console.log('[BottomSheetModal] Fallback: calling snapToIndex(0)');
|
|
110
|
-
modalRef.current.snapToIndex(0);
|
|
111
|
-
}
|
|
112
|
-
}, 50);
|
|
113
|
-
} catch (error) {
|
|
114
|
-
if (__DEV__) console.error('[BottomSheetModal] Error calling present():', error);
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
dismiss: () => {
|
|
118
|
-
if (__DEV__) console.log('[BottomSheetModal] dismiss() called');
|
|
119
|
-
modalRef.current?.dismiss();
|
|
120
|
-
},
|
|
121
|
-
snapToIndex: (index: number) => {
|
|
122
|
-
if (__DEV__) console.log('[BottomSheetModal] snapToIndex called', { index });
|
|
123
|
-
modalRef.current?.snapToIndex(index);
|
|
124
|
-
},
|
|
125
|
-
snapToPosition: (pos: string | number) => modalRef.current?.snapToPosition(pos),
|
|
126
|
-
expand: () => modalRef.current?.expand(),
|
|
127
|
-
collapse: () => modalRef.current?.collapse(),
|
|
128
|
-
}));
|
|
34
|
+
const present = useCallback(() => {
|
|
35
|
+
if (__DEV__) console.log('[BottomSheetModal] Opening');
|
|
36
|
+
setVisible(true);
|
|
37
|
+
}, []);
|
|
129
38
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
preset
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}, []);
|
|
39
|
+
const dismiss = useCallback(() => {
|
|
40
|
+
if (__DEV__) console.log('[BottomSheetModal] Closing');
|
|
41
|
+
setVisible(false);
|
|
42
|
+
onDismiss?.();
|
|
43
|
+
}, [onDismiss]);
|
|
139
44
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
45
|
+
useImperativeHandle(ref, () => ({
|
|
46
|
+
present,
|
|
47
|
+
dismiss,
|
|
48
|
+
snapToIndex: (index: number) => {
|
|
49
|
+
if (index >= 0) present();
|
|
50
|
+
else dismiss();
|
|
51
|
+
},
|
|
52
|
+
snapToPosition: () => present(),
|
|
53
|
+
expand: () => present(),
|
|
54
|
+
collapse: () => dismiss(),
|
|
55
|
+
}));
|
|
147
56
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
57
|
+
const styles = StyleSheet.create({
|
|
58
|
+
overlay: {
|
|
59
|
+
flex: 1,
|
|
60
|
+
backgroundColor: tokens.colors.modalOverlay,
|
|
61
|
+
justifyContent: 'flex-end',
|
|
62
|
+
},
|
|
63
|
+
container: {
|
|
64
|
+
height: sheetHeight,
|
|
65
|
+
backgroundColor: backgroundColor || tokens.colors.surface,
|
|
66
|
+
borderTopLeftRadius: borderRadius,
|
|
67
|
+
borderTopRightRadius: borderRadius,
|
|
68
|
+
paddingBottom: Math.max(insets.bottom, 8),
|
|
69
|
+
...Platform.select({
|
|
70
|
+
ios: {
|
|
71
|
+
shadowColor: tokens.colors.black,
|
|
72
|
+
shadowOffset: { width: 0, height: -4 },
|
|
73
|
+
shadowOpacity: 0.15,
|
|
74
|
+
shadowRadius: 12,
|
|
75
|
+
},
|
|
76
|
+
android: {
|
|
77
|
+
elevation: 8,
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
handle: {
|
|
82
|
+
width: 40,
|
|
83
|
+
height: 4,
|
|
84
|
+
backgroundColor: tokens.colors.border,
|
|
85
|
+
borderRadius: 2,
|
|
86
|
+
alignSelf: 'center',
|
|
87
|
+
marginTop: 12,
|
|
88
|
+
marginBottom: 8,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
175
91
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
92
|
+
return (
|
|
93
|
+
<Modal
|
|
94
|
+
visible={visible}
|
|
95
|
+
transparent
|
|
96
|
+
animationType="slide"
|
|
97
|
+
onRequestClose={dismiss}
|
|
98
|
+
statusBarTranslucent
|
|
99
|
+
>
|
|
100
|
+
<Pressable style={styles.overlay} onPress={dismiss}>
|
|
101
|
+
<View style={styles.container}>
|
|
102
|
+
<Pressable onPress={(e) => e.stopPropagation()}>
|
|
103
|
+
<View style={styles.handle} />
|
|
104
|
+
{children}
|
|
105
|
+
</Pressable>
|
|
106
|
+
</View>
|
|
107
|
+
</Pressable>
|
|
108
|
+
</Modal>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
192
112
|
|
|
113
|
+
BottomSheetModal.displayName = 'BottomSheetModal';
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
3
2
|
|
|
4
|
-
interface SafeBottomSheetModalProviderProps {
|
|
3
|
+
export interface SafeBottomSheetModalProviderProps {
|
|
5
4
|
children: ReactNode;
|
|
6
5
|
}
|
|
7
6
|
|
|
7
|
+
/**
|
|
8
|
+
* SafeBottomSheetModalProvider
|
|
9
|
+
*
|
|
10
|
+
* Simple wrapper for backward compatibility.
|
|
11
|
+
* No longer uses @gorhom/bottom-sheet provider.
|
|
12
|
+
*/
|
|
8
13
|
export const SafeBottomSheetModalProvider = ({ children }: SafeBottomSheetModalProviderProps) => {
|
|
9
|
-
|
|
10
|
-
if (__DEV__) {
|
|
11
|
-
console.log('[SafeBottomSheetModalProvider] Mounted and providing context');
|
|
12
|
-
}
|
|
13
|
-
}, []);
|
|
14
|
-
|
|
15
|
-
if (__DEV__) {
|
|
16
|
-
console.log('[SafeBottomSheetModalProvider] Rendering');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return <BottomSheetModalProvider>{children}</BottomSheetModalProvider>;
|
|
14
|
+
return <>{children}</>;
|
|
20
15
|
};
|
|
21
|
-
|
package/src/molecules/index.ts
CHANGED
|
@@ -39,12 +39,6 @@ export * from './swipe-actions';
|
|
|
39
39
|
// Navigation
|
|
40
40
|
export * from './navigation';
|
|
41
41
|
|
|
42
|
-
// Celebration
|
|
43
|
-
export * from './celebration';
|
|
44
|
-
|
|
45
|
-
// Animation
|
|
46
|
-
export * from './animation';
|
|
47
|
-
|
|
48
42
|
// Long Press Menu
|
|
49
43
|
export * from './long-press-menu';
|
|
50
44
|
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Animation Core Exports
|
|
3
|
-
*
|
|
4
|
-
* Re-exports react-native-reanimated for centralized usage.
|
|
5
|
-
* All packages should use this instead of importing directly.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
useSharedValue,
|
|
10
|
-
useAnimatedStyle,
|
|
11
|
-
withTiming,
|
|
12
|
-
withSpring,
|
|
13
|
-
withSequence,
|
|
14
|
-
withRepeat,
|
|
15
|
-
runOnJS,
|
|
16
|
-
cancelAnimation,
|
|
17
|
-
Easing,
|
|
18
|
-
} from 'react-native-reanimated';
|
|
19
|
-
|
|
20
|
-
// Re-export Animated namespace
|
|
21
|
-
import Animated from 'react-native-reanimated';
|
|
22
|
-
export { Animated };
|
|
23
|
-
|
|
24
|
-
// Re-export types
|
|
25
|
-
export type {
|
|
26
|
-
SharedValue,
|
|
27
|
-
WithTimingConfig,
|
|
28
|
-
WithSpringConfig,
|
|
29
|
-
} from 'react-native-reanimated';
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Animation Domain Entity
|
|
3
|
-
*
|
|
4
|
-
* Core animation types and configurations for React Native.
|
|
5
|
-
* Wraps react-native-reanimated and react-native-gesture-handler.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { WithSpringConfig, WithTimingConfig } from 'react-native-reanimated';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Animation timing configuration
|
|
12
|
-
*/
|
|
13
|
-
export type AnimationTimingConfig = WithTimingConfig & {
|
|
14
|
-
duration?: number;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Animation spring configuration
|
|
19
|
-
*/
|
|
20
|
-
export type AnimationSpringConfig = WithSpringConfig & {
|
|
21
|
-
damping?: number;
|
|
22
|
-
stiffness?: number;
|
|
23
|
-
mass?: number;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Animation preset types
|
|
28
|
-
*/
|
|
29
|
-
export enum AnimationPreset {
|
|
30
|
-
FADE_IN = 'fadeIn',
|
|
31
|
-
FADE_OUT = 'fadeOut',
|
|
32
|
-
SLIDE_IN_UP = 'slideInUp',
|
|
33
|
-
SLIDE_IN_DOWN = 'slideInDown',
|
|
34
|
-
SLIDE_IN_LEFT = 'slideInLeft',
|
|
35
|
-
SLIDE_IN_RIGHT = 'slideInRight',
|
|
36
|
-
SCALE_IN = 'scaleIn',
|
|
37
|
-
SCALE_OUT = 'scaleOut',
|
|
38
|
-
BOUNCE = 'bounce',
|
|
39
|
-
SHAKE = 'shake',
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Gesture type
|
|
44
|
-
*/
|
|
45
|
-
export enum GestureType {
|
|
46
|
-
TAP = 'tap',
|
|
47
|
-
PAN = 'pan',
|
|
48
|
-
PINCH = 'pinch',
|
|
49
|
-
ROTATION = 'rotation',
|
|
50
|
-
LONG_PRESS = 'longPress',
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Animation easing functions
|
|
55
|
-
*/
|
|
56
|
-
export enum AnimationEasing {
|
|
57
|
-
LINEAR = 'linear',
|
|
58
|
-
EASE_IN = 'easeIn',
|
|
59
|
-
EASE_OUT = 'easeOut',
|
|
60
|
-
EASE_IN_OUT = 'easeInOut',
|
|
61
|
-
BOUNCE = 'bounce',
|
|
62
|
-
ELASTIC = 'elastic',
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Animation constants
|
|
67
|
-
*/
|
|
68
|
-
export const ANIMATION_CONSTANTS = {
|
|
69
|
-
DURATION: {
|
|
70
|
-
INSTANT: 0,
|
|
71
|
-
FAST: 200,
|
|
72
|
-
NORMAL: 300,
|
|
73
|
-
SLOW: 500,
|
|
74
|
-
VERY_SLOW: 1000,
|
|
75
|
-
},
|
|
76
|
-
SPRING: {
|
|
77
|
-
DAMPING: 10,
|
|
78
|
-
STIFFNESS: 100,
|
|
79
|
-
MASS: 1,
|
|
80
|
-
},
|
|
81
|
-
} as const;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fireworks Domain Entity
|
|
3
|
-
*
|
|
4
|
-
* Types and constants for fireworks particle system
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Particle configuration
|
|
9
|
-
*/
|
|
10
|
-
export interface ParticleConfig {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
color: string;
|
|
14
|
-
size: number;
|
|
15
|
-
velocityX: number;
|
|
16
|
-
velocityY: number;
|
|
17
|
-
life: number;
|
|
18
|
-
decay: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Fireworks configuration
|
|
23
|
-
*/
|
|
24
|
-
export interface FireworksConfig {
|
|
25
|
-
particleCount?: number;
|
|
26
|
-
colors: string[]; // Required - colors must be provided by consumer
|
|
27
|
-
duration?: number;
|
|
28
|
-
particleSize?: number;
|
|
29
|
-
spread?: number;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Fireworks constants
|
|
34
|
-
*/
|
|
35
|
-
export const FIREWORKS_CONSTANTS = {
|
|
36
|
-
DEFAULT_PARTICLE_COUNT: 50,
|
|
37
|
-
DEFAULT_DURATION: 2000,
|
|
38
|
-
DEFAULT_PARTICLE_SIZE: 4,
|
|
39
|
-
DEFAULT_SPREAD: 100,
|
|
40
|
-
DEFAULT_COLORS: [] as string[], // Colors should be provided by consumer
|
|
41
|
-
GRAVITY: 0.3,
|
|
42
|
-
DECAY_RATE: 0.02,
|
|
43
|
-
} as const;
|
|
44
|
-
|