@umituz/react-native-design-system 4.27.25 → 4.27.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "4.27.25",
3
+ "version": "4.27.26",
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",
@@ -127,6 +127,27 @@ export {
127
127
  export { storageService } from './infrastructure/adapters/StorageService';
128
128
  export type { StateStorage } from './domain/types/Store';
129
129
 
130
+ // =============================================================================
131
+ // ZUSTAND STORAGE - Sync API for Zustand persist middleware
132
+ // =============================================================================
133
+
134
+ /**
135
+ * Zustand-compatible storage export
136
+ *
137
+ * AsyncStorage natively provides the Promise-based API that Zustand persist expects.
138
+ * This is a centralized export for all Zustand stores to use.
139
+ *
140
+ * @example
141
+ * import { createStore, zustandStorage } from '@umituz/react-native-design-system/storage';
142
+ *
143
+ * createStore({
144
+ * persist: true,
145
+ * storage: zustandStorage,
146
+ * ...
147
+ * });
148
+ */
149
+ export { zustandStorage } from './infrastructure/adapters/ZustandStorageAdapter';
150
+
130
151
  // =============================================================================
131
152
  // PRESENTATION LAYER - Hooks
132
153
  // =============================================================================
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Zustand Storage Adapter
3
+ *
4
+ * Provides AsyncStorage in a format compatible with Zustand persist middleware.
5
+ *
6
+ * AsyncStorage natively supports the Promise-based API that Zustand expects:
7
+ * - getItem: (key: string) => Promise<string | null>
8
+ * - setItem: (key: string, value: string) => Promise<void>
9
+ * - removeItem: (key: string) => Promise<void>
10
+ *
11
+ * This is a centralized export point for Zustand stores throughout the app.
12
+ *
13
+ * @example
14
+ * import { createStore, zustandStorage } from '@umituz/react-native-design-system/storage';
15
+ *
16
+ * const store = createStore({
17
+ * persist: true,
18
+ * storage: zustandStorage,
19
+ * ...
20
+ * });
21
+ */
22
+
23
+ import AsyncStorage from '@react-native-async-storage/async-storage';
24
+
25
+ /**
26
+ * Zustand-compatible storage export
27
+ *
28
+ * AsyncStorage instance that can be used directly with Zustand's persist middleware.
29
+ * No wrapping needed - AsyncStorage already provides the correct interface.
30
+ */
31
+ export const zustandStorage = AsyncStorage;