@umituz/react-native-design-system 4.27.30 → 4.27.32

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.
@@ -11,4 +11,15 @@ export declare class AlertService {
11
11
  static createErrorAlert(title: string, message?: string, options?: AlertOptions): Alert;
12
12
  static createWarningAlert(title: string, message?: string, options?: AlertOptions): Alert;
13
13
  static createInfoAlert(title: string, message?: string, options?: AlertOptions): Alert;
14
+ /**
15
+ * Convenience methods to show alerts directly from outside React components
16
+ * These access the Zustand store directly without requiring hooks
17
+ */
18
+ static success(title: string, message?: string, options?: AlertOptions): string;
19
+ static error(title: string, message?: string, options?: AlertOptions): string;
20
+ static warning(title: string, message?: string, options?: AlertOptions): string;
21
+ static info(title: string, message?: string, options?: AlertOptions): string;
22
+ static show(type: AlertType, mode: AlertMode, title: string, message?: string, options?: AlertOptions): string;
23
+ static dismiss(id: string): void;
24
+ static clear(): void;
14
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "4.27.30",
3
+ "version": "4.27.32",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities - TanStack persistence and expo-image-manipulator now lazy loaded",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./dist/index.d.ts",
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { generateUUID } from '../../uuid';
6
6
  import { Alert, AlertType, AlertMode, AlertOptions, AlertPosition } from './AlertTypes';
7
+ import { useAlertStore } from './AlertStore';
7
8
 
8
9
  export class AlertService {
9
10
  /**
@@ -57,4 +58,46 @@ export class AlertService {
57
58
  static createInfoAlert(title: string, message?: string, options?: AlertOptions): Alert {
58
59
  return this.createAlert(AlertType.INFO, AlertMode.TOAST, title, message, options);
59
60
  }
61
+
62
+ /**
63
+ * Convenience methods to show alerts directly from outside React components
64
+ * These access the Zustand store directly without requiring hooks
65
+ */
66
+ static success(title: string, message?: string, options?: AlertOptions): string {
67
+ const alert = this.createSuccessAlert(title, message, options);
68
+ useAlertStore.getState().addAlert(alert);
69
+ return alert.id;
70
+ }
71
+
72
+ static error(title: string, message?: string, options?: AlertOptions): string {
73
+ const alert = this.createErrorAlert(title, message, options);
74
+ useAlertStore.getState().addAlert(alert);
75
+ return alert.id;
76
+ }
77
+
78
+ static warning(title: string, message?: string, options?: AlertOptions): string {
79
+ const alert = this.createWarningAlert(title, message, options);
80
+ useAlertStore.getState().addAlert(alert);
81
+ return alert.id;
82
+ }
83
+
84
+ static info(title: string, message?: string, options?: AlertOptions): string {
85
+ const alert = this.createInfoAlert(title, message, options);
86
+ useAlertStore.getState().addAlert(alert);
87
+ return alert.id;
88
+ }
89
+
90
+ static show(type: AlertType, mode: AlertMode, title: string, message?: string, options?: AlertOptions): string {
91
+ const alert = this.createAlert(type, mode, title, message, options);
92
+ useAlertStore.getState().addAlert(alert);
93
+ return alert.id;
94
+ }
95
+
96
+ static dismiss(id: string): void {
97
+ useAlertStore.getState().dismissAlert(id);
98
+ }
99
+
100
+ static clear(): void {
101
+ useAlertStore.getState().clearAlerts();
102
+ }
60
103
  }
@@ -146,7 +146,7 @@ export type { StateStorage } from './domain/types/Store';
146
146
  * ...
147
147
  * });
148
148
  */
149
- export { persistentStorage, zustandStorage } from './infrastructure/adapters/ZustandStorageAdapter';
149
+ export { persistentStorage } from './infrastructure/adapters/ZustandStorageAdapter';
150
150
 
151
151
  // =============================================================================
152
152
  // PRESENTATION LAYER - Hooks
@@ -29,8 +29,3 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
29
29
  * No wrapping needed - AsyncStorage already provides the correct interface.
30
30
  */
31
31
  export const persistentStorage = AsyncStorage;
32
-
33
- /**
34
- * @deprecated Use persistentStorage instead
35
- */
36
- export const zustandStorage = AsyncStorage;