@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.
Files changed (72) hide show
  1. package/lib/index.d.ts +2 -3
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +2 -3
  4. package/lib/index.js.map +1 -1
  5. package/lib/presentation/atoms/AtomicButton.d.ts +0 -1
  6. package/lib/presentation/atoms/AtomicButton.d.ts.map +1 -1
  7. package/lib/presentation/atoms/AtomicButton.js +6 -9
  8. package/lib/presentation/atoms/AtomicButton.js.map +1 -1
  9. package/lib/presentation/atoms/AtomicFab.d.ts +0 -1
  10. package/lib/presentation/atoms/AtomicFab.d.ts.map +1 -1
  11. package/lib/presentation/atoms/AtomicFab.js +4 -5
  12. package/lib/presentation/atoms/AtomicFab.js.map +1 -1
  13. package/lib/presentation/atoms/AtomicProgress.d.ts +0 -3
  14. package/lib/presentation/atoms/AtomicProgress.d.ts.map +1 -1
  15. package/lib/presentation/atoms/AtomicProgress.js +1 -2
  16. package/lib/presentation/atoms/AtomicProgress.js.map +1 -1
  17. package/lib/presentation/atoms/AtomicTouchable.d.ts +1 -11
  18. package/lib/presentation/atoms/AtomicTouchable.d.ts.map +1 -1
  19. package/lib/presentation/atoms/AtomicTouchable.js +6 -19
  20. package/lib/presentation/atoms/AtomicTouchable.js.map +1 -1
  21. package/lib/presentation/atoms/fab/types/index.d.ts +0 -5
  22. package/lib/presentation/atoms/fab/types/index.d.ts.map +1 -1
  23. package/lib/presentation/atoms/index.d.ts +1 -4
  24. package/lib/presentation/atoms/index.d.ts.map +1 -1
  25. package/lib/presentation/atoms/index.js +0 -3
  26. package/lib/presentation/atoms/index.js.map +1 -1
  27. package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts +0 -5
  28. package/lib/presentation/atoms/touchable/styles/touchableStyles.d.ts.map +1 -1
  29. package/lib/presentation/atoms/touchable/styles/touchableStyles.js +0 -8
  30. package/lib/presentation/atoms/touchable/styles/touchableStyles.js.map +1 -1
  31. package/lib/presentation/atoms/touchable/types/index.d.ts +1 -7
  32. package/lib/presentation/atoms/touchable/types/index.d.ts.map +1 -1
  33. package/lib/presentation/organisms/ScreenLayout.d.ts +0 -15
  34. package/lib/presentation/organisms/ScreenLayout.d.ts.map +1 -1
  35. package/lib/presentation/organisms/ScreenLayout.js +1 -10
  36. package/lib/presentation/organisms/ScreenLayout.js.map +1 -1
  37. package/lib/presentation/tokens/AppDesignTokens.d.ts +1 -1
  38. package/lib/presentation/tokens/AppDesignTokens.d.ts.map +1 -1
  39. package/lib/presentation/tokens/AppDesignTokens.js +1 -1
  40. package/lib/presentation/tokens/AppDesignTokens.js.map +1 -1
  41. package/lib/presentation/tokens/core/BaseTokens.d.ts +0 -25
  42. package/lib/presentation/tokens/core/BaseTokens.d.ts.map +1 -1
  43. package/lib/presentation/tokens/core/BaseTokens.js +1 -16
  44. package/lib/presentation/tokens/core/BaseTokens.js.map +1 -1
  45. package/lib/presentation/tokens/core/TokenFactory.d.ts +2 -15
  46. package/lib/presentation/tokens/core/TokenFactory.d.ts.map +1 -1
  47. package/lib/presentation/tokens/core/TokenFactory.js +1 -2
  48. package/lib/presentation/tokens/core/TokenFactory.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/index.ts +1 -4
  51. package/src/presentation/atoms/AtomicButton.tsx +5 -16
  52. package/src/presentation/atoms/AtomicFab.tsx +3 -9
  53. package/src/presentation/atoms/AtomicProgress.tsx +0 -4
  54. package/src/presentation/atoms/AtomicTouchable.tsx +3 -27
  55. package/src/presentation/atoms/fab/types/index.ts +0 -6
  56. package/src/presentation/atoms/index.ts +0 -12
  57. package/src/presentation/atoms/touchable/styles/touchableStyles.ts +0 -9
  58. package/src/presentation/atoms/touchable/types/index.ts +1 -8
  59. package/src/presentation/organisms/ScreenLayout.tsx +0 -40
  60. package/src/presentation/tokens/AppDesignTokens.ts +0 -2
  61. package/src/presentation/tokens/core/BaseTokens.ts +1 -19
  62. package/src/presentation/tokens/core/TokenFactory.ts +2 -4
  63. package/lib/presentation/atoms/AtomicSkeleton.d.ts +0 -37
  64. package/lib/presentation/atoms/AtomicSkeleton.d.ts.map +0 -1
  65. package/lib/presentation/atoms/AtomicSkeleton.js +0 -53
  66. package/lib/presentation/atoms/AtomicSkeleton.js.map +0 -1
  67. package/lib/presentation/loading/presentation/components/LoadingState.d.ts +0 -39
  68. package/lib/presentation/loading/presentation/components/LoadingState.d.ts.map +0 -1
  69. package/lib/presentation/loading/presentation/components/LoadingState.js +0 -123
  70. package/lib/presentation/loading/presentation/components/LoadingState.js.map +0 -1
  71. package/src/presentation/atoms/AtomicSkeleton.tsx +0 -95
  72. package/src/presentation/loading/presentation/components/LoadingState.tsx +0 -200
@@ -35,15 +35,6 @@ export const getDisabledStyle = (): ViewStyle => ({
35
35
  opacity: 0.5,
36
36
  });
37
37
 
38
- /**
39
- * Get loading container style
40
- * Centers the loading indicator
41
- */
42
- export const getLoadingContainerStyle = (): ViewStyle => ({
43
- justifyContent: 'center',
44
- alignItems: 'center',
45
- });
46
-
47
38
  /**
48
39
  * Convert number to HitSlop object
49
40
  * If hitSlop is a number, apply it to all sides
@@ -40,8 +40,7 @@ export interface HitSlop {
40
40
  * onPress={handlePress}
41
41
  * feedback="opacity"
42
42
  * strength="normal"
43
- * disabled={isLoading}
44
- * loading={isLoading}
43
+ * disabled={isDisabled}
45
44
  * hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
46
45
  * style={styles.touchable}
47
46
  * >
@@ -93,12 +92,6 @@ export interface AtomicTouchableProps {
93
92
  */
94
93
  disabled?: boolean;
95
94
 
96
- /**
97
- * Show loading indicator (disables touch)
98
- * @default false
99
- */
100
- loading?: boolean;
101
-
102
95
  /**
103
96
  * Hit slop - extends touchable area
104
97
  * Useful for small touch targets
@@ -4,7 +4,6 @@
4
4
  * Provides consistent layout structure for all screens:
5
5
  * - SafeAreaView with configurable edges
6
6
  * - Optional ScrollView for content
7
- * - Loading state support
8
7
  * - Theme-aware background colors
9
8
  * - Optional header/footer slots
10
9
  * - Consistent spacing and padding
@@ -17,7 +16,6 @@
17
16
  * Advanced:
18
17
  * <ScreenLayout
19
18
  * scrollable={false}
20
- * loading={isLoading}
21
19
  * edges={['top', 'bottom']}
22
20
  * header={<CustomHeader />}
23
21
  * >
@@ -29,7 +27,6 @@ import React, { useMemo } from 'react';
29
27
  import { View, ScrollView, StyleSheet, ViewStyle } from 'react-native';
30
28
  import { SafeAreaView, Edge } from 'react-native-safe-area-context';
31
29
  import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
32
- import { LoadingState } from '../loading/presentation/components/LoadingState';
33
30
 
34
31
  export interface ScreenLayoutProps {
35
32
  /**
@@ -52,22 +49,6 @@ export interface ScreenLayoutProps {
52
49
  */
53
50
  edges?: Edge[];
54
51
 
55
- /**
56
- * Show loading state
57
- * When true, displays LoadingState component
58
- */
59
- loading?: boolean;
60
-
61
- /**
62
- * Loading icon name (default: 'settings')
63
- */
64
- loadingIcon?: string;
65
-
66
- /**
67
- * Loading message (default: 'Loading...')
68
- */
69
- loadingMessage?: string;
70
-
71
52
  /**
72
53
  * Optional header component
73
54
  * Rendered above scrollable content
@@ -118,9 +99,6 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
118
99
  children,
119
100
  scrollable = true,
120
101
  edges = ['top'],
121
- loading = false,
122
- loadingIcon = 'settings',
123
- loadingMessage = 'Loading...',
124
102
  header,
125
103
  footer,
126
104
  backgroundColor,
@@ -136,24 +114,6 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
136
114
 
137
115
  const bgColor = backgroundColor || tokens.colors.backgroundPrimary;
138
116
 
139
- // Show loading state
140
- if (loading) {
141
- return (
142
- <SafeAreaView
143
- style={[styles.container, { backgroundColor: bgColor }, containerStyle]}
144
- edges={edges}
145
- testID={testID}
146
- >
147
- <LoadingState
148
- icon={loadingIcon}
149
- message={loadingMessage}
150
- size="large"
151
- fullScreen
152
- />
153
- </SafeAreaView>
154
- );
155
- }
156
-
157
117
  // Non-scrollable layout
158
118
  if (!scrollable) {
159
119
  return (
@@ -31,14 +31,12 @@ export {
31
31
  BASE_TOKENS,
32
32
  spacing,
33
33
  typography,
34
- animations,
35
34
  borders,
36
35
  iconSizes,
37
36
  opacity,
38
37
  avatarSizes,
39
38
  type Spacing,
40
39
  type Typography,
41
- type Animations,
42
40
  type Borders,
43
41
  type IconSizes,
44
42
  type Opacity,
@@ -220,25 +220,9 @@ export const typography = {
220
220
  } as const;
221
221
 
222
222
  // =============================================================================
223
- // ANIMATION TOKENS
223
+ // ANIMATION TOKENS - REMOVED (moved to separate package)
224
224
  // =============================================================================
225
225
 
226
- export const animations = {
227
- // Duration scale (milliseconds)
228
- fastest: 150,
229
- fast: 150,
230
- normal: 300,
231
- slow: 500,
232
- slower: 750,
233
- slowest: 1000,
234
-
235
- // Easing functions
236
- easeInOut: 'ease-in-out' as const,
237
- easeIn: 'ease-in' as const,
238
- easeOut: 'ease-out' as const,
239
- linear: 'linear' as const,
240
- } as const;
241
-
242
226
  // =============================================================================
243
227
  // OPACITY TOKENS
244
228
  // =============================================================================
@@ -371,7 +355,6 @@ export const avatarSizes = {
371
355
  export const BASE_TOKENS = {
372
356
  spacing,
373
357
  typography,
374
- animations,
375
358
  opacity,
376
359
  borders,
377
360
  sizes,
@@ -385,7 +368,6 @@ export const BASE_TOKENS = {
385
368
 
386
369
  export type Spacing = typeof spacing;
387
370
  export type Typography = typeof typography;
388
- export type Animations = typeof animations;
389
371
  export type Opacity = typeof opacity;
390
372
  export type Borders = typeof borders;
391
373
  export type Sizes = typeof sizes;
@@ -18,13 +18,12 @@ import { getColorPalette, withAlpha, type ThemeMode, type ColorPalette } from '.
18
18
 
19
19
  /**
20
20
  * Complete design tokens shape
21
- * Combines static tokens (spacing, typography, animations, borders) + dynamic colors
21
+ * Combines static tokens (spacing, typography, borders) + dynamic colors
22
22
  */
23
23
  export type DesignTokens = {
24
24
  colors: ColorPalette;
25
25
  spacing: typeof BASE_TOKENS.spacing;
26
26
  typography: typeof BASE_TOKENS.typography;
27
- animations: typeof BASE_TOKENS.animations;
28
27
  iconSizes: typeof BASE_TOKENS.iconSizes;
29
28
  opacity: typeof BASE_TOKENS.opacity;
30
29
  avatarSizes: typeof BASE_TOKENS.avatarSizes;
@@ -67,7 +66,6 @@ export const createDesignTokens = (mode: ThemeMode): DesignTokens => {
67
66
  // ✅ STATIC: These don't change with theme
68
67
  spacing: BASE_TOKENS.spacing,
69
68
  typography: BASE_TOKENS.typography,
70
- animations: BASE_TOKENS.animations,
71
69
  iconSizes: BASE_TOKENS.iconSizes,
72
70
  opacity: BASE_TOKENS.opacity,
73
71
  avatarSizes: BASE_TOKENS.avatarSizes,
@@ -107,7 +105,7 @@ export const createDesignTokens = (mode: ThemeMode): DesignTokens => {
107
105
  export const STATIC_DESIGN_TOKENS = createDesignTokens('light');
108
106
 
109
107
  /**
110
- * STATIC TOKENS (spacing, typography, animations, borders)
108
+ * STATIC TOKENS (spacing, typography, borders)
111
109
  * These DON'T change with theme - safe to use anywhere
112
110
  */
113
111
  export const STATIC_TOKENS = BASE_TOKENS;
@@ -1,37 +0,0 @@
1
- /**
2
- * AtomicSkeleton - Universal Skeleton Loading Component
3
- *
4
- * Displays skeleton placeholders for loading states
5
- * Theme: {{THEME_NAME}} ({{CATEGORY}} category)
6
- *
7
- * Atomic Design Level: ATOM
8
- * Purpose: Loading state placeholder
9
- *
10
- * Usage:
11
- * - Content loading placeholders
12
- * - List item skeletons
13
- * - Card skeletons
14
- * - Text line skeletons
15
- * - Image placeholders
16
- */
17
- import React from 'react';
18
- import { ViewStyle } from 'react-native';
19
- export interface AtomicSkeletonProps {
20
- /** Skeleton width */
21
- width?: number | string;
22
- /** Skeleton height */
23
- height?: number | string;
24
- /** Skeleton shape */
25
- shape?: 'rectangle' | 'circle' | 'rounded';
26
- /** Border radius for rounded shapes */
27
- borderRadius?: number;
28
- /** Skeleton color */
29
- color?: string;
30
- /** Style overrides */
31
- style?: ViewStyle;
32
- /** Test ID for testing */
33
- testID?: string;
34
- }
35
- export declare const AtomicSkeleton: React.FC<AtomicSkeletonProps>;
36
- export default AtomicSkeleton;
37
- //# sourceMappingURL=AtomicSkeleton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AtomicSkeleton.d.ts","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicSkeleton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAkB,MAAM,cAAc,CAAC;AAO3E,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,qBAAqB;IACrB,KAAK,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0CxD,CAAC;AAMF,eAAe,cAAc,CAAC"}
@@ -1,53 +0,0 @@
1
- /**
2
- * AtomicSkeleton - Universal Skeleton Loading Component
3
- *
4
- * Displays skeleton placeholders for loading states
5
- * Theme: {{THEME_NAME}} ({{CATEGORY}} category)
6
- *
7
- * Atomic Design Level: ATOM
8
- * Purpose: Loading state placeholder
9
- *
10
- * Usage:
11
- * - Content loading placeholders
12
- * - List item skeletons
13
- * - Card skeletons
14
- * - Text line skeletons
15
- * - Image placeholders
16
- */
17
- import React from 'react';
18
- import { View } from 'react-native';
19
- import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
20
- // =============================================================================
21
- // COMPONENT IMPLEMENTATION
22
- // =============================================================================
23
- export const AtomicSkeleton = ({ width = '100%', height = 20, shape = 'rectangle', borderRadius, color, style, testID, }) => {
24
- const tokens = useAppDesignTokens();
25
- // Default values
26
- const skeletonColor = color || tokens.colors.surfaceVariant;
27
- // Calculate border radius based on shape
28
- const getBorderRadius = () => {
29
- if (borderRadius !== undefined)
30
- return borderRadius;
31
- switch (shape) {
32
- case 'circle':
33
- return typeof height === 'number' ? height / 2 : 20;
34
- case 'rounded':
35
- return tokens.borders.radius.md;
36
- case 'rectangle':
37
- default:
38
- return tokens.borders.radius.sm;
39
- }
40
- };
41
- const skeletonStyle = {
42
- width: width,
43
- height: height,
44
- backgroundColor: skeletonColor,
45
- borderRadius: getBorderRadius(),
46
- };
47
- return (<View style={[skeletonStyle, style]} testID={testID}/>);
48
- };
49
- // =============================================================================
50
- // EXPORTS
51
- // =============================================================================
52
- export default AtomicSkeleton;
53
- //# sourceMappingURL=AtomicSkeleton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AtomicSkeleton.js","sourceRoot":"","sources":["../../../src/presentation/atoms/AtomicSkeleton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAyC,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAuBjE,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,EAC5D,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,EAAE,EACX,KAAK,GAAG,WAAW,EACnB,YAAY,EACZ,KAAK,EACL,KAAK,EACL,MAAM,GACP,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IAEpC,iBAAiB;IACjB,MAAM,aAAa,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;IAE5D,yCAAyC;IACzC,MAAM,eAAe,GAAG,GAAW,EAAE;QACnC,IAAI,YAAY,KAAK,SAAS;YAAE,OAAO,YAAY,CAAC;QAEpD,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,QAAQ;gBACX,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,KAAK,SAAS;gBACZ,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,KAAK,WAAW,CAAC;YACjB;gBACE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAc;QAC/B,KAAK,EAAE,KAAuB;QAC9B,MAAM,EAAE,MAAwB;QAChC,eAAe,EAAE,aAAa;QAC9B,YAAY,EAAE,eAAe,EAAE;KAChC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAC9B,MAAM,CAAC,CAAC,MAAM,CAAC,EACf,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF,eAAe,cAAc,CAAC"}
@@ -1,39 +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
- import React from 'react';
17
- export type LoadingStateSize = 'small' | 'medium' | 'large';
18
- export interface LoadingStateProps {
19
- /**
20
- * Emoji/icon to display (changes per screen context)
21
- * Examples: 🏠 Home, ⚙️ Settings, 💪 Workout, 🧘 Meditation, 📊 Analytics
22
- */
23
- icon?: string;
24
- /**
25
- * Optional loading message
26
- */
27
- message?: string;
28
- /**
29
- * Size variant
30
- */
31
- size?: LoadingStateSize;
32
- /**
33
- * Full screen overlay mode
34
- */
35
- fullScreen?: boolean;
36
- }
37
- export declare const LoadingState: React.FC<LoadingStateProps>;
38
- export default LoadingState;
39
- //# sourceMappingURL=LoadingState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingState.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/loading/presentation/components/LoadingState.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAqC,MAAM,OAAO,CAAC;AAe1D,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAkCD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4EpD,CAAC;AAmCF,eAAe,YAAY,CAAC"}
@@ -1,123 +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
- import React, { useRef, useEffect, useMemo } from 'react';
17
- import { View, StyleSheet, Animated, Easing, } from 'react-native';
18
- import { useAppDesignTokens } from '../../../hooks/useAppDesignTokens';
19
- import { AtomicText } from '../../../atoms/AtomicText';
20
- const SIZE_CONFIG = {
21
- small: {
22
- iconSize: 32,
23
- showMessage: false,
24
- containerPadding: 16,
25
- },
26
- medium: {
27
- iconSize: 48,
28
- showMessage: true,
29
- containerPadding: 24,
30
- },
31
- large: {
32
- iconSize: 64,
33
- showMessage: true,
34
- containerPadding: 32,
35
- },
36
- };
37
- // =============================================================================
38
- // COMPONENT IMPLEMENTATION
39
- // =============================================================================
40
- export const LoadingState = ({ icon = '⏳', // Default hourglass icon
41
- message, size = 'large', fullScreen = false, }) => {
42
- // ✅ Dynamic theme tokens
43
- const tokens = useAppDesignTokens();
44
- // Animation ref for breathing effect
45
- const scaleAnim = useRef(new Animated.Value(1)).current;
46
- // Size configuration
47
- const config = SIZE_CONFIG[size];
48
- /**
49
- * Breathing Animation Effect
50
- * Smoothly scales icon from 1 → 1.15 → 1 in continuous loop
51
- * Creates calming, natural breathing sensation
52
- */
53
- useEffect(() => {
54
- const breathingAnimation = Animated.loop(Animated.sequence([
55
- // Expand (inhale)
56
- Animated.timing(scaleAnim, {
57
- toValue: 1.15,
58
- duration: tokens.animations.slowest,
59
- easing: Easing.inOut(Easing.ease),
60
- useNativeDriver: true,
61
- }),
62
- // Contract (exhale)
63
- Animated.timing(scaleAnim, {
64
- toValue: 1,
65
- duration: tokens.animations.slowest,
66
- easing: Easing.inOut(Easing.ease),
67
- useNativeDriver: true,
68
- }),
69
- ]));
70
- breathingAnimation.start();
71
- return () => {
72
- breathingAnimation.stop();
73
- };
74
- }, [scaleAnim]);
75
- // Dynamic styles based on theme
76
- const styles = useMemo(() => getStyles(tokens, config, fullScreen), [tokens, config, fullScreen]);
77
- return (<View style={styles.container}>
78
- {/* Animated Icon/Emoji */}
79
- <Animated.Text style={[
80
- styles.icon,
81
- {
82
- fontSize: config.iconSize,
83
- transform: [{ scale: scaleAnim }],
84
- },
85
- ]}>
86
- {icon}
87
- </Animated.Text>
88
-
89
- {/* Optional Loading Message */}
90
- {config.showMessage && message && (<AtomicText type="bodyMedium" style={styles.message}>
91
- {message}
92
- </AtomicText>)}
93
- </View>);
94
- };
95
- // =============================================================================
96
- // STYLES
97
- // =============================================================================
98
- const getStyles = (tokens, config, fullScreen) => StyleSheet.create({
99
- container: {
100
- ...(fullScreen ? {
101
- flex: 1,
102
- justifyContent: 'center',
103
- alignItems: 'center',
104
- backgroundColor: tokens.colors.backgroundPrimary,
105
- } : {
106
- justifyContent: 'center',
107
- alignItems: 'center',
108
- padding: config.containerPadding,
109
- }),
110
- },
111
- icon: {
112
- textAlign: 'center',
113
- marginBottom: tokens.spacing.md,
114
- },
115
- message: {
116
- color: tokens.colors.textSecondary,
117
- textAlign: 'center',
118
- marginTop: tokens.spacing.sm,
119
- maxWidth: 300,
120
- },
121
- });
122
- export default LoadingState;
123
- //# sourceMappingURL=LoadingState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingState.js","sourceRoot":"","sources":["../../../../../src/presentation/loading/presentation/components/LoadingState.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EACL,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAyCvD,MAA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MAA6C,EAC7C,MAAkB,EAClB,UAAmB,EACnB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrB,SAAS,EAAE;QACT,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB;SACjD,CAAC,CAAC,CAAC;YACF,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,MAAM,CAAC,gBAAgB;SACjC,CAAC;KACH;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;KAChC;IACD,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa;QAClC,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;QAC5B,QAAQ,EAAE,GAAG;KACd;CACF,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -1,95 +0,0 @@
1
- /**
2
- * AtomicSkeleton - Universal Skeleton Loading Component
3
- *
4
- * Displays skeleton placeholders for loading states
5
- * Theme: {{THEME_NAME}} ({{CATEGORY}} category)
6
- *
7
- * Atomic Design Level: ATOM
8
- * Purpose: Loading state placeholder
9
- *
10
- * Usage:
11
- * - Content loading placeholders
12
- * - List item skeletons
13
- * - Card skeletons
14
- * - Text line skeletons
15
- * - Image placeholders
16
- */
17
-
18
- import React from 'react';
19
- import { View, StyleSheet, ViewStyle, DimensionValue } from 'react-native';
20
- import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
21
-
22
- // =============================================================================
23
- // TYPE DEFINITIONS
24
- // =============================================================================
25
-
26
- export interface AtomicSkeletonProps {
27
- /** Skeleton width */
28
- width?: number | string;
29
- /** Skeleton height */
30
- height?: number | string;
31
- /** Skeleton shape */
32
- shape?: 'rectangle' | 'circle' | 'rounded';
33
- /** Border radius for rounded shapes */
34
- borderRadius?: number;
35
- /** Skeleton color */
36
- color?: string;
37
- /** Style overrides */
38
- style?: ViewStyle;
39
- /** Test ID for testing */
40
- testID?: string;
41
- }
42
-
43
- // =============================================================================
44
- // COMPONENT IMPLEMENTATION
45
- // =============================================================================
46
-
47
- export const AtomicSkeleton: React.FC<AtomicSkeletonProps> = ({
48
- width = '100%',
49
- height = 20,
50
- shape = 'rectangle',
51
- borderRadius,
52
- color,
53
- style,
54
- testID,
55
- }) => {
56
- const tokens = useAppDesignTokens();
57
-
58
- // Default values
59
- const skeletonColor = color || tokens.colors.surfaceVariant;
60
-
61
- // Calculate border radius based on shape
62
- const getBorderRadius = (): number => {
63
- if (borderRadius !== undefined) return borderRadius;
64
-
65
- switch (shape) {
66
- case 'circle':
67
- return typeof height === 'number' ? height / 2 : 20;
68
- case 'rounded':
69
- return tokens.borders.radius.md;
70
- case 'rectangle':
71
- default:
72
- return tokens.borders.radius.sm;
73
- }
74
- };
75
-
76
- const skeletonStyle: ViewStyle = {
77
- width: width as DimensionValue,
78
- height: height as DimensionValue,
79
- backgroundColor: skeletonColor,
80
- borderRadius: getBorderRadius(),
81
- };
82
-
83
- return (
84
- <View
85
- style={[skeletonStyle, style]}
86
- testID={testID}
87
- />
88
- );
89
- };
90
-
91
- // =============================================================================
92
- // EXPORTS
93
- // =============================================================================
94
-
95
- export default AtomicSkeleton;