@umituz/react-native-design-system 1.4.1 → 1.4.3
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/lib/index.d.ts +2 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -3
- package/lib/index.js.map +1 -1
- package/lib/presentation/atoms/AtomicButton.d.ts +0 -1
- package/lib/presentation/atoms/AtomicButton.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicButton.js +6 -9
- package/lib/presentation/atoms/AtomicButton.js.map +1 -1
- package/lib/presentation/atoms/AtomicFab.d.ts +0 -1
- package/lib/presentation/atoms/AtomicFab.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicFab.js +4 -5
- package/lib/presentation/atoms/AtomicFab.js.map +1 -1
- package/lib/presentation/atoms/AtomicProgress.d.ts +0 -3
- package/lib/presentation/atoms/AtomicProgress.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicProgress.js +1 -2
- package/lib/presentation/atoms/AtomicProgress.js.map +1 -1
- package/lib/presentation/atoms/AtomicTouchable.d.ts +1 -11
- package/lib/presentation/atoms/AtomicTouchable.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicTouchable.js +6 -19
- package/lib/presentation/atoms/AtomicTouchable.js.map +1 -1
- package/lib/presentation/atoms/fab/types/index.d.ts +0 -5
- package/lib/presentation/atoms/fab/types/index.d.ts.map +1 -1
- package/lib/presentation/atoms/index.d.ts +1 -4
- package/lib/presentation/atoms/index.d.ts.map +1 -1
- package/lib/presentation/atoms/index.js +0 -3
- package/lib/presentation/atoms/index.js.map +1 -1
- package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts +0 -5
- package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts.map +1 -1
- package/lib/presentation/atoms/touchable/styles/touchableStyles.js +0 -8
- package/lib/presentation/atoms/touchable/styles/touchableStyles.js.map +1 -1
- package/lib/presentation/atoms/touchable/types/index.d.ts +1 -7
- package/lib/presentation/atoms/touchable/types/index.d.ts.map +1 -1
- package/lib/presentation/organisms/ScreenLayout.d.ts +0 -15
- package/lib/presentation/organisms/ScreenLayout.d.ts.map +1 -1
- package/lib/presentation/organisms/ScreenLayout.js +1 -10
- package/lib/presentation/organisms/ScreenLayout.js.map +1 -1
- package/lib/presentation/tokens/AppDesignTokens.d.ts +1 -1
- package/lib/presentation/tokens/AppDesignTokens.d.ts.map +1 -1
- package/lib/presentation/tokens/AppDesignTokens.js +1 -1
- package/lib/presentation/tokens/AppDesignTokens.js.map +1 -1
- package/lib/presentation/tokens/core/BaseTokens.d.ts +0 -25
- package/lib/presentation/tokens/core/BaseTokens.d.ts.map +1 -1
- package/lib/presentation/tokens/core/BaseTokens.js +1 -16
- package/lib/presentation/tokens/core/BaseTokens.js.map +1 -1
- package/lib/presentation/tokens/core/TokenFactory.d.ts +2 -15
- package/lib/presentation/tokens/core/TokenFactory.d.ts.map +1 -1
- package/lib/presentation/tokens/core/TokenFactory.js +1 -2
- package/lib/presentation/tokens/core/TokenFactory.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -4
- package/src/presentation/atoms/AtomicButton.tsx +5 -16
- package/src/presentation/atoms/AtomicFab.tsx +3 -9
- package/src/presentation/atoms/AtomicProgress.tsx +0 -4
- package/src/presentation/atoms/AtomicTouchable.tsx +3 -27
- package/src/presentation/atoms/fab/types/index.ts +0 -6
- package/src/presentation/atoms/index.ts +0 -12
- package/src/presentation/atoms/touchable/styles/touchableStyles.ts +0 -9
- package/src/presentation/atoms/touchable/types/index.ts +1 -8
- package/src/presentation/organisms/ScreenLayout.tsx +0 -40
- package/src/presentation/tokens/AppDesignTokens.ts +0 -2
- package/src/presentation/tokens/core/BaseTokens.ts +1 -19
- package/src/presentation/tokens/core/TokenFactory.ts +2 -4
- package/lib/presentation/atoms/AtomicSkeleton.d.ts +0 -37
- package/lib/presentation/atoms/AtomicSkeleton.d.ts.map +0 -1
- package/lib/presentation/atoms/AtomicSkeleton.js +0 -53
- package/lib/presentation/atoms/AtomicSkeleton.js.map +0 -1
- package/lib/presentation/loading/presentation/components/LoadingState.d.ts +0 -39
- package/lib/presentation/loading/presentation/components/LoadingState.d.ts.map +0 -1
- package/lib/presentation/loading/presentation/components/LoadingState.js +0 -123
- package/lib/presentation/loading/presentation/components/LoadingState.js.map +0 -1
- package/src/presentation/atoms/AtomicSkeleton.tsx +0 -95
- package/src/presentation/loading/presentation/components/LoadingState.tsx +0 -200
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LoadingState - Dynamic Icon-Based Loading Component
|
|
3
|
-
*
|
|
4
|
-
* Universal loading component with configurable emoji/icon support
|
|
5
|
-
* Inspired by meditation_timer's breathing animation pattern
|
|
6
|
-
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
7
|
-
*
|
|
8
|
-
* Features:
|
|
9
|
-
* - ✅ Dynamic emoji/icon per screen (🏠 Home, ⚙️ Settings, 💪 Workout, etc.)
|
|
10
|
-
* - ✅ Breathing animation effect (scale 1 → 1.15 → 1)
|
|
11
|
-
* - ✅ Size variants (small, medium, large)
|
|
12
|
-
* - ✅ Full screen or inline modes
|
|
13
|
-
* - ✅ Optional loading message
|
|
14
|
-
* - ✅ Theme-aware styling
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import React, { useRef, useEffect, useMemo } from 'react';
|
|
18
|
-
import {
|
|
19
|
-
View,
|
|
20
|
-
StyleSheet,
|
|
21
|
-
Animated,
|
|
22
|
-
Easing,
|
|
23
|
-
} from 'react-native';
|
|
24
|
-
import { useAppDesignTokens } from '../../../hooks/useAppDesignTokens';
|
|
25
|
-
import { STATIC_TOKENS } from '../../../tokens/AppDesignTokens';
|
|
26
|
-
import { AtomicText } from '../../../atoms/AtomicText';
|
|
27
|
-
|
|
28
|
-
// =============================================================================
|
|
29
|
-
// TYPE DEFINITIONS
|
|
30
|
-
// =============================================================================
|
|
31
|
-
|
|
32
|
-
export type LoadingStateSize = 'small' | 'medium' | 'large';
|
|
33
|
-
|
|
34
|
-
export interface LoadingStateProps {
|
|
35
|
-
/**
|
|
36
|
-
* Emoji/icon to display (changes per screen context)
|
|
37
|
-
* Examples: 🏠 Home, ⚙️ Settings, 💪 Workout, 🧘 Meditation, 📊 Analytics
|
|
38
|
-
*/
|
|
39
|
-
icon?: string;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Optional loading message
|
|
43
|
-
*/
|
|
44
|
-
message?: string;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Size variant
|
|
48
|
-
*/
|
|
49
|
-
size?: LoadingStateSize;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Full screen overlay mode
|
|
53
|
-
*/
|
|
54
|
-
fullScreen?: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// =============================================================================
|
|
58
|
-
// SIZE CONFIGURATION
|
|
59
|
-
// =============================================================================
|
|
60
|
-
|
|
61
|
-
interface SizeConfig {
|
|
62
|
-
iconSize: number;
|
|
63
|
-
showMessage: boolean;
|
|
64
|
-
containerPadding: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const SIZE_CONFIG: Record<LoadingStateSize, SizeConfig> = {
|
|
68
|
-
small: {
|
|
69
|
-
iconSize: 32,
|
|
70
|
-
showMessage: false,
|
|
71
|
-
containerPadding: 16,
|
|
72
|
-
},
|
|
73
|
-
medium: {
|
|
74
|
-
iconSize: 48,
|
|
75
|
-
showMessage: true,
|
|
76
|
-
containerPadding: 24,
|
|
77
|
-
},
|
|
78
|
-
large: {
|
|
79
|
-
iconSize: 64,
|
|
80
|
-
showMessage: true,
|
|
81
|
-
containerPadding: 32,
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// =============================================================================
|
|
86
|
-
// COMPONENT IMPLEMENTATION
|
|
87
|
-
// =============================================================================
|
|
88
|
-
|
|
89
|
-
export const LoadingState: React.FC<LoadingStateProps> = ({
|
|
90
|
-
icon = '⏳', // Default hourglass icon
|
|
91
|
-
message,
|
|
92
|
-
size = 'large',
|
|
93
|
-
fullScreen = false,
|
|
94
|
-
}) => {
|
|
95
|
-
// ✅ Dynamic theme tokens
|
|
96
|
-
const tokens = useAppDesignTokens();
|
|
97
|
-
|
|
98
|
-
// Animation ref for breathing effect
|
|
99
|
-
const scaleAnim = useRef(new Animated.Value(1)).current;
|
|
100
|
-
|
|
101
|
-
// Size configuration
|
|
102
|
-
const config = SIZE_CONFIG[size];
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Breathing Animation Effect
|
|
106
|
-
* Smoothly scales icon from 1 → 1.15 → 1 in continuous loop
|
|
107
|
-
* Creates calming, natural breathing sensation
|
|
108
|
-
*/
|
|
109
|
-
useEffect(() => {
|
|
110
|
-
const breathingAnimation = Animated.loop(
|
|
111
|
-
Animated.sequence([
|
|
112
|
-
// Expand (inhale)
|
|
113
|
-
Animated.timing(scaleAnim, {
|
|
114
|
-
toValue: 1.15,
|
|
115
|
-
duration: tokens.animations.slowest,
|
|
116
|
-
easing: Easing.inOut(Easing.ease),
|
|
117
|
-
useNativeDriver: true,
|
|
118
|
-
}),
|
|
119
|
-
// Contract (exhale)
|
|
120
|
-
Animated.timing(scaleAnim, {
|
|
121
|
-
toValue: 1,
|
|
122
|
-
duration: tokens.animations.slowest,
|
|
123
|
-
easing: Easing.inOut(Easing.ease),
|
|
124
|
-
useNativeDriver: true,
|
|
125
|
-
}),
|
|
126
|
-
])
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
breathingAnimation.start();
|
|
130
|
-
|
|
131
|
-
return () => {
|
|
132
|
-
breathingAnimation.stop();
|
|
133
|
-
};
|
|
134
|
-
}, [scaleAnim]);
|
|
135
|
-
|
|
136
|
-
// Dynamic styles based on theme
|
|
137
|
-
const styles = useMemo(() => getStyles(tokens, config, fullScreen), [tokens, config, fullScreen]);
|
|
138
|
-
|
|
139
|
-
return (
|
|
140
|
-
<View style={styles.container}>
|
|
141
|
-
{/* Animated Icon/Emoji */}
|
|
142
|
-
<Animated.Text
|
|
143
|
-
style={[
|
|
144
|
-
styles.icon,
|
|
145
|
-
{
|
|
146
|
-
fontSize: config.iconSize,
|
|
147
|
-
transform: [{ scale: scaleAnim }],
|
|
148
|
-
},
|
|
149
|
-
]}
|
|
150
|
-
>
|
|
151
|
-
{icon}
|
|
152
|
-
</Animated.Text>
|
|
153
|
-
|
|
154
|
-
{/* Optional Loading Message */}
|
|
155
|
-
{config.showMessage && message && (
|
|
156
|
-
<AtomicText
|
|
157
|
-
type="bodyMedium"
|
|
158
|
-
style={styles.message}
|
|
159
|
-
>
|
|
160
|
-
{message}
|
|
161
|
-
</AtomicText>
|
|
162
|
-
)}
|
|
163
|
-
</View>
|
|
164
|
-
);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// =============================================================================
|
|
168
|
-
// STYLES
|
|
169
|
-
// =============================================================================
|
|
170
|
-
|
|
171
|
-
const getStyles = (
|
|
172
|
-
tokens: ReturnType<typeof useAppDesignTokens>,
|
|
173
|
-
config: SizeConfig,
|
|
174
|
-
fullScreen: boolean
|
|
175
|
-
) => StyleSheet.create({
|
|
176
|
-
container: {
|
|
177
|
-
...(fullScreen ? {
|
|
178
|
-
flex: 1,
|
|
179
|
-
justifyContent: 'center',
|
|
180
|
-
alignItems: 'center',
|
|
181
|
-
backgroundColor: tokens.colors.backgroundPrimary,
|
|
182
|
-
} : {
|
|
183
|
-
justifyContent: 'center',
|
|
184
|
-
alignItems: 'center',
|
|
185
|
-
padding: config.containerPadding,
|
|
186
|
-
}),
|
|
187
|
-
},
|
|
188
|
-
icon: {
|
|
189
|
-
textAlign: 'center',
|
|
190
|
-
marginBottom: tokens.spacing.md,
|
|
191
|
-
},
|
|
192
|
-
message: {
|
|
193
|
-
color: tokens.colors.textSecondary,
|
|
194
|
-
textAlign: 'center',
|
|
195
|
-
marginTop: tokens.spacing.sm,
|
|
196
|
-
maxWidth: 300,
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
export default LoadingState;
|