@umituz/react-native-exception 1.0.1 → 1.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 CHANGED
@@ -27,3 +27,10 @@ SOFTWARE.
27
27
 
28
28
 
29
29
 
30
+
31
+
32
+
33
+
34
+
35
+
36
+
package/README.md CHANGED
@@ -6,6 +6,7 @@ Exception handling and error tracking for React Native apps.
6
6
 
7
7
  - Centralized exception handling
8
8
  - Error boundary component
9
+ - Empty state component for no data scenarios
9
10
  - Exception store with Zustand
10
11
  - Error categorization and severity levels
11
12
  - Exception reporting utilities
@@ -21,6 +22,8 @@ npm install @umituz/react-native-exception
21
22
  - `react` >= 18.2.0
22
23
  - `react-native` >= 0.74.0
23
24
  - `zustand` >= 5.0.2
25
+ - `@umituz/react-native-design-system-theme` >= 1.0.0
26
+ - `@umituz/react-native-design-system` >= 1.0.0
24
27
 
25
28
  ## Usage
26
29
 
@@ -59,6 +62,20 @@ import { useExceptionStore } from '@umituz/react-native-exception';
59
62
  const { exceptions, lastError } = useExceptionStore();
60
63
  ```
61
64
 
65
+ ### Empty State
66
+
67
+ ```typescript
68
+ import { EmptyState } from '@umituz/react-native-exception';
69
+
70
+ <EmptyState
71
+ icon="inbox"
72
+ title="No items found"
73
+ description="Start by adding your first item"
74
+ actionLabel="Add Item"
75
+ onAction={() => navigation.navigate('Add')}
76
+ />
77
+ ```
78
+
62
79
  ## License
63
80
 
64
81
  MIT
@@ -70,3 +87,8 @@ MIT
70
87
 
71
88
 
72
89
 
90
+
91
+
92
+
93
+
94
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-exception",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Exception handling and error tracking for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -22,7 +22,7 @@
22
22
  "error-boundary",
23
23
  "crash-reporting"
24
24
  ],
25
- "author": "\u00dcmit UZ <umit@umituz.com>",
25
+ "author": "Ümit UZ <umit@umituz.com>",
26
26
  "license": "MIT",
27
27
  "repository": {
28
28
  "type": "git",
@@ -32,10 +32,11 @@
32
32
  "react": ">=18.2.0",
33
33
  "react-native": ">=0.74.0",
34
34
  "zustand": "^5.0.2",
35
- "@umituz/react-native-theme": "*"
35
+ "@umituz/react-native-design-system-theme": "*",
36
+ "@umituz/react-native-design-system": "*"
36
37
  },
37
38
  "peerDependenciesMeta": {
38
- "@umituz/react-native-theme": {
39
+ "@umituz/react-native-design-system-theme": {
39
40
  "optional": false
40
41
  }
41
42
  },
@@ -46,7 +47,8 @@
46
47
  "react": "^18.2.0",
47
48
  "react-native": "^0.74.0",
48
49
  "zustand": "^5.0.2",
49
- "@umituz/react-native-theme": "latest"
50
+ "@umituz/react-native-design-system-theme": "latest",
51
+ "@umituz/react-native-design-system": "latest"
50
52
  },
51
53
  "publishConfig": {
52
54
  "access": "public"
@@ -104,3 +104,10 @@ export function shouldReportException(exception: ExceptionEntity): boolean {
104
104
 
105
105
 
106
106
 
107
+
108
+
109
+
110
+
111
+
112
+
113
+
@@ -51,3 +51,10 @@ export interface IExceptionRepository {
51
51
 
52
52
 
53
53
 
54
+
55
+
56
+
57
+
58
+
59
+
60
+
package/src/index.ts CHANGED
@@ -48,6 +48,13 @@ export { ExceptionService, exceptionService } from './infrastructure/services/Ex
48
48
 
49
49
  // Components
50
50
  export { ErrorBoundary } from './presentation/components/ErrorBoundary';
51
+ export { EmptyState } from './presentation/components/EmptyState';
52
+ export type { EmptyStateProps } from './presentation/components/EmptyState';
53
+
54
+
55
+
56
+
57
+
51
58
 
52
59
 
53
60
 
@@ -107,3 +107,10 @@ export const exceptionService = ExceptionService.getInstance();
107
107
 
108
108
 
109
109
 
110
+
111
+
112
+
113
+
114
+
115
+
116
+
@@ -100,3 +100,10 @@ export const useExceptions = () => {
100
100
 
101
101
 
102
102
 
103
+
104
+
105
+
106
+
107
+
108
+
109
+
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Empty State Component
3
+ * Displays when no data is available
4
+ *
5
+ * Presentation Layer - UI Component
6
+ */
7
+
8
+ import React from "react";
9
+ import { View, StyleSheet, TouchableOpacity } from "react-native";
10
+ import {
11
+ useAppDesignTokens,
12
+ AtomicIcon,
13
+ AtomicText,
14
+ STATIC_TOKENS,
15
+ } from "@umituz/react-native-design-system";
16
+
17
+ export interface EmptyStateProps {
18
+ icon?: string;
19
+ title: string;
20
+ description?: string;
21
+ actionLabel?: string;
22
+ onAction?: () => void;
23
+ illustration?: React.ReactNode;
24
+ }
25
+
26
+ export const EmptyState: React.FC<EmptyStateProps> = ({
27
+ icon = "inbox",
28
+ title,
29
+ description,
30
+ actionLabel,
31
+ onAction,
32
+ illustration,
33
+ }) => {
34
+ const tokens = useAppDesignTokens();
35
+
36
+ return (
37
+ <View style={styles.container}>
38
+ {illustration ? (
39
+ illustration
40
+ ) : (
41
+ <View
42
+ style={[
43
+ styles.iconContainer,
44
+ { backgroundColor: tokens.colors.surface },
45
+ ]}
46
+ >
47
+ <AtomicIcon name={icon} size="xxl" color="secondary" />
48
+ </View>
49
+ )}
50
+
51
+ <AtomicText
52
+ type="headlineSmall"
53
+ color="primary"
54
+ style={[styles.title, { textAlign: "center" }]}
55
+ >
56
+ {title}
57
+ </AtomicText>
58
+
59
+ {description && (
60
+ <AtomicText
61
+ type="bodyMedium"
62
+ color="secondary"
63
+ style={[styles.description, { textAlign: "center" }]}
64
+ >
65
+ {description}
66
+ </AtomicText>
67
+ )}
68
+
69
+ {actionLabel && onAction && (
70
+ <TouchableOpacity
71
+ style={[
72
+ styles.actionButton,
73
+ { backgroundColor: tokens.colors.primary },
74
+ ]}
75
+ onPress={onAction}
76
+ activeOpacity={0.8}
77
+ >
78
+ <AtomicText
79
+ type="labelLarge"
80
+ color="onPrimary"
81
+ style={styles.actionButtonText}
82
+ >
83
+ {actionLabel}
84
+ </AtomicText>
85
+ </TouchableOpacity>
86
+ )}
87
+ </View>
88
+ );
89
+ };
90
+
91
+ const styles = StyleSheet.create({
92
+ container: {
93
+ flex: 1,
94
+ alignItems: "center",
95
+ justifyContent: "center",
96
+ padding: STATIC_TOKENS.spacing.xl,
97
+ },
98
+ iconContainer: {
99
+ width: 120,
100
+ height: 120,
101
+ borderRadius: 60,
102
+ alignItems: "center",
103
+ justifyContent: "center",
104
+ marginBottom: STATIC_TOKENS.spacing.lg,
105
+ },
106
+ title: {
107
+ marginBottom: STATIC_TOKENS.spacing.sm,
108
+ },
109
+ description: {
110
+ marginBottom: STATIC_TOKENS.spacing.lg,
111
+ maxWidth: 280,
112
+ },
113
+ actionButton: {
114
+ paddingHorizontal: STATIC_TOKENS.spacing.lg,
115
+ paddingVertical: STATIC_TOKENS.spacing.md,
116
+ borderRadius: STATIC_TOKENS.borders.radius.md,
117
+ marginTop: STATIC_TOKENS.spacing.sm,
118
+ },
119
+ actionButtonText: {
120
+ // AtomicText handles typography
121
+ },
122
+ });
123
+
@@ -6,7 +6,7 @@
6
6
  import React, { Component, ReactNode } from 'react';
7
7
  import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
8
8
  import { exceptionService } from '../../infrastructure/services/ExceptionService';
9
- import { useAppDesignTokens } from '@umituz/react-native-theme';
9
+ import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
10
10
 
11
11
  interface Props {
12
12
  children: ReactNode;