@umituz/react-native-design-system 2.6.48 → 2.6.50
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 +1 -12
- 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.50",
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef, useImperativeHandle, useState, useCallback } from 'react';
|
|
2
|
-
import { Modal, View, StyleSheet, Pressable
|
|
2
|
+
import { Modal, View, StyleSheet, Pressable } from 'react-native';
|
|
3
3
|
import { useAppDesignTokens } from '../../../theme';
|
|
4
4
|
import { useSafeAreaInsets } from '../../../safe-area';
|
|
5
5
|
import { getResponsiveBottomSheetLayout } from '../../../responsive';
|
|
@@ -66,17 +66,6 @@ export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModal
|
|
|
66
66
|
borderTopLeftRadius: borderRadius,
|
|
67
67
|
borderTopRightRadius: borderRadius,
|
|
68
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
69
|
},
|
|
81
70
|
handle: {
|
|
82
71
|
width: 40,
|
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
|
-
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme System for Animation Package
|
|
3
|
-
*
|
|
4
|
-
* Provides theme-aware animation configurations.
|
|
5
|
-
* Consumers can provide their own theme or use defaults.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface AnimationTheme {
|
|
9
|
-
colors: {
|
|
10
|
-
primary: string;
|
|
11
|
-
secondary: string;
|
|
12
|
-
success: string;
|
|
13
|
-
warning: string;
|
|
14
|
-
error: string;
|
|
15
|
-
info: string;
|
|
16
|
-
};
|
|
17
|
-
spacing: {
|
|
18
|
-
xs: number;
|
|
19
|
-
sm: number;
|
|
20
|
-
md: number;
|
|
21
|
-
lg: number;
|
|
22
|
-
xl: number;
|
|
23
|
-
};
|
|
24
|
-
borderRadius: {
|
|
25
|
-
sm: number;
|
|
26
|
-
md: number;
|
|
27
|
-
lg: number;
|
|
28
|
-
full: number;
|
|
29
|
-
};
|
|
30
|
-
opacity: {
|
|
31
|
-
transparent: number;
|
|
32
|
-
light: number;
|
|
33
|
-
medium: number;
|
|
34
|
-
heavy: number;
|
|
35
|
-
opaque: number;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const DEFAULT_ANIMATION_THEME: AnimationTheme = {
|
|
40
|
-
colors: {
|
|
41
|
-
primary: '#007AFF',
|
|
42
|
-
secondary: '#5856D6',
|
|
43
|
-
success: '#34C759',
|
|
44
|
-
warning: '#FF9500',
|
|
45
|
-
error: '#FF3B30',
|
|
46
|
-
info: '#5AC8FA',
|
|
47
|
-
},
|
|
48
|
-
spacing: {
|
|
49
|
-
xs: 4,
|
|
50
|
-
sm: 8,
|
|
51
|
-
md: 16,
|
|
52
|
-
lg: 24,
|
|
53
|
-
xl: 32,
|
|
54
|
-
},
|
|
55
|
-
borderRadius: {
|
|
56
|
-
sm: 4,
|
|
57
|
-
md: 8,
|
|
58
|
-
lg: 12,
|
|
59
|
-
full: 9999,
|
|
60
|
-
},
|
|
61
|
-
opacity: {
|
|
62
|
-
transparent: 0,
|
|
63
|
-
light: 0.25,
|
|
64
|
-
medium: 0.5,
|
|
65
|
-
heavy: 0.75,
|
|
66
|
-
opaque: 1,
|
|
67
|
-
},
|
|
68
|
-
} as const;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Theme context for React components
|
|
72
|
-
*/
|
|
73
|
-
export interface ThemeContext {
|
|
74
|
-
theme: AnimationTheme;
|
|
75
|
-
setTheme: (theme: Partial<AnimationTheme>) => void;
|
|
76
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React Native Animation - Barrel Export
|
|
3
|
-
*
|
|
4
|
-
* Universal animation system for React Native with react-native-reanimated.
|
|
5
|
-
* Provides declarative animations, gesture handling, and preset configurations.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Declarative animations (fade, slide, scale, bounce, shake)
|
|
9
|
-
* - Spring physics animations
|
|
10
|
-
* - Gesture handling (tap, pan, pinch, long press)
|
|
11
|
-
* - Preset animation configs
|
|
12
|
-
* - TypeScript type safety
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
*
|
|
16
|
-
* Animation Example:
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { useAnimation, Animated } from '@umituz/react-native-animation';
|
|
19
|
-
*
|
|
20
|
-
* const MyComponent = () => {
|
|
21
|
-
* const { fadeIn, animatedStyle } = useAnimation();
|
|
22
|
-
*
|
|
23
|
-
* useEffect(() => {
|
|
24
|
-
* fadeIn();
|
|
25
|
-
* }, []);
|
|
26
|
-
*
|
|
27
|
-
* return <Animated.View style={animatedStyle}>...</Animated.View>;
|
|
28
|
-
* };
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* Gesture Example:
|
|
32
|
-
* ```typescript
|
|
33
|
-
* import { useGesture, Animated } from '@umituz/react-native-animation';
|
|
34
|
-
*
|
|
35
|
-
* const MyComponent = () => {
|
|
36
|
-
* const { createPanGesture, animatedStyle, GestureDetector } = useGesture();
|
|
37
|
-
*
|
|
38
|
-
* const panGesture = createPanGesture({
|
|
39
|
-
* onEnd: (x, y) => console.log('Dragged to:', x, y),
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* return (
|
|
43
|
-
* <GestureDetector gesture={panGesture}>
|
|
44
|
-
* <Animated.View style={animatedStyle}>...</Animated.View>
|
|
45
|
-
* </GestureDetector>
|
|
46
|
-
* );
|
|
47
|
-
* };
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* Technical:
|
|
51
|
-
* - Uses react-native-reanimated v3 for animations
|
|
52
|
-
* - Uses react-native-gesture-handler for gestures
|
|
53
|
-
* - Zero backend dependencies
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
// =============================================================================
|
|
57
|
-
// CORE LAYER - Animation Primitives
|
|
58
|
-
// =============================================================================
|
|
59
|
-
|
|
60
|
-
export {
|
|
61
|
-
Animated,
|
|
62
|
-
useSharedValue,
|
|
63
|
-
useAnimatedStyle,
|
|
64
|
-
withTiming,
|
|
65
|
-
withSpring,
|
|
66
|
-
withSequence,
|
|
67
|
-
withRepeat,
|
|
68
|
-
runOnJS,
|
|
69
|
-
cancelAnimation,
|
|
70
|
-
Easing,
|
|
71
|
-
} from './core/AnimationCore';
|
|
72
|
-
|
|
73
|
-
export type {
|
|
74
|
-
SharedValue,
|
|
75
|
-
WithTimingConfig,
|
|
76
|
-
WithSpringConfig,
|
|
77
|
-
} from './core/AnimationCore';
|
|
78
|
-
|
|
79
|
-
// =============================================================================
|
|
80
|
-
// DOMAIN LAYER - Entities
|
|
81
|
-
// =============================================================================
|
|
82
|
-
|
|
83
|
-
export {
|
|
84
|
-
AnimationPreset,
|
|
85
|
-
GestureType,
|
|
86
|
-
AnimationEasing,
|
|
87
|
-
ANIMATION_CONSTANTS,
|
|
88
|
-
} from './domain/entities/Animation';
|
|
89
|
-
export type {
|
|
90
|
-
AnimationTimingConfig,
|
|
91
|
-
AnimationSpringConfig,
|
|
92
|
-
} from './domain/entities/Animation';
|
|
93
|
-
|
|
94
|
-
// Infrastructure Layer - Services
|
|
95
|
-
export { AnimationConfigService } from './infrastructure/services/AnimationConfigService';
|
|
96
|
-
export { TimingAnimationConfigService } from './infrastructure/services/TimingAnimationConfigService';
|
|
97
|
-
export { SpringAnimationConfigService } from './infrastructure/services/SpringAnimationConfigService';
|
|
98
|
-
|
|
99
|
-
// Presentation Layer - Hooks
|
|
100
|
-
export { useAnimation } from './presentation/hooks/useAnimation';
|
|
101
|
-
export {
|
|
102
|
-
useGesture,
|
|
103
|
-
type TapGestureOptions,
|
|
104
|
-
type PanGestureOptions,
|
|
105
|
-
type PinchGestureOptions,
|
|
106
|
-
} from './presentation/hooks/useGesture';
|
|
107
|
-
export { useReanimatedReady } from './presentation/hooks/useReanimatedReady';
|
|
108
|
-
export { useFireworks } from './presentation/hooks/useFireworks';
|
|
109
|
-
export {
|
|
110
|
-
useOverlayAnimations,
|
|
111
|
-
useModalAnimations, // Legacy
|
|
112
|
-
type OverlayAnimationConfig,
|
|
113
|
-
type UseOverlayAnimationsReturn,
|
|
114
|
-
type ModalAnimationConfig, // Legacy
|
|
115
|
-
type UseModalAnimationsReturn, // Legacy
|
|
116
|
-
} from './presentation/hooks/useModalAnimations';
|
|
117
|
-
export {
|
|
118
|
-
useElementAnimations,
|
|
119
|
-
useIconAnimations, // Legacy
|
|
120
|
-
type ElementAnimationConfig,
|
|
121
|
-
type UseElementAnimationsReturn,
|
|
122
|
-
type IconAnimationConfig, // Legacy
|
|
123
|
-
type UseIconAnimationsReturn, // Legacy
|
|
124
|
-
} from './presentation/hooks/useIconAnimations';
|
|
125
|
-
|
|
126
|
-
// Presentation Layer - Components
|
|
127
|
-
export { Fireworks } from './presentation/components/Fireworks';
|
|
128
|
-
export type { FireworksProps } from './presentation/components/Fireworks';
|
|
129
|
-
|
|
130
|
-
// Domain Layer - Fireworks
|
|
131
|
-
export type {
|
|
132
|
-
ParticleConfig,
|
|
133
|
-
FireworksConfig,
|
|
134
|
-
} from './domain/entities/Fireworks';
|
|
135
|
-
export { FIREWORKS_CONSTANTS } from './domain/entities/Fireworks';
|
|
136
|
-
|
|
137
|
-
// Domain Layer - Theme
|
|
138
|
-
export type {
|
|
139
|
-
AnimationTheme,
|
|
140
|
-
ThemeContext,
|
|
141
|
-
} from './domain/entities/Theme';
|
|
142
|
-
export { DEFAULT_ANIMATION_THEME } from './domain/entities/Theme';
|
|
143
|
-
|
|
144
|
-
// Presentation Layer - Providers
|
|
145
|
-
export { AnimationThemeProvider, useAnimationTheme } from './presentation/providers/AnimationThemeProvider';
|
|
146
|
-
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Animation Config Service (Legacy)
|
|
3
|
-
*
|
|
4
|
-
* Legacy service for backward compatibility.
|
|
5
|
-
* New implementations should use TimingAnimationConfigService and SpringAnimationConfigService.
|
|
6
|
-
* @deprecated Use TimingAnimationConfigService and SpringAnimationConfigService instead
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import type {
|
|
10
|
-
AnimationTimingConfig,
|
|
11
|
-
AnimationSpringConfig,
|
|
12
|
-
} from '../../domain/entities/Animation';
|
|
13
|
-
import { AnimationPreset } from '../../domain/entities/Animation';
|
|
14
|
-
import { TimingAnimationConfigService } from './TimingAnimationConfigService';
|
|
15
|
-
import { SpringAnimationConfigService } from './SpringAnimationConfigService';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use TimingAnimationConfigService and SpringAnimationConfigService instead
|
|
19
|
-
*/
|
|
20
|
-
export class AnimationConfigService {
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Use TimingAnimationConfigService.getTimingConfig instead
|
|
23
|
-
*/
|
|
24
|
-
static getTimingConfig(preset: AnimationPreset): AnimationTimingConfig {
|
|
25
|
-
return TimingAnimationConfigService.getTimingConfig(preset);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Use SpringAnimationConfigService.getSpringConfig instead
|
|
30
|
-
*/
|
|
31
|
-
static getSpringConfig(preset: AnimationPreset): AnimationSpringConfig {
|
|
32
|
-
return SpringAnimationConfigService.getSpringConfig(preset);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|