@umituz/react-native-design-system 4.27.15 → 4.27.17
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/dist/core/cache/domain/CleanupStrategy.d.ts +62 -0
- package/dist/core/cache/domain/UnifiedCache.d.ts +82 -0
- package/dist/core/cache/domain/types.d.ts +15 -0
- package/dist/core/cache/index.d.ts +13 -0
- package/dist/core/cache/infrastructure/CacheFactory.d.ts +63 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/permissions/domain/PermissionHandler.d.ts +82 -0
- package/dist/core/permissions/domain/types.d.ts +42 -0
- package/dist/core/permissions/index.d.ts +7 -0
- package/dist/core/repositories/domain/RepositoryKeyFactory.d.ts +25 -0
- package/dist/core/repositories/domain/RepositoryUtils.d.ts +39 -0
- package/dist/core/repositories/domain/types.d.ts +53 -0
- package/dist/core/repositories/index.d.ts +10 -0
- package/dist/hooks/index.d.ts +27 -0
- package/dist/index.d.ts +1 -0
- package/dist/media/domain/strategies/CameraPickerStrategy.d.ts +25 -0
- package/dist/media/domain/strategies/LibraryPickerStrategy.d.ts +18 -0
- package/dist/media/domain/strategies/PickerStrategy.d.ts +55 -0
- package/dist/media/domain/strategies/index.d.ts +10 -0
- package/dist/media/infrastructure/services/MediaPickerService.d.ts +49 -6
- package/dist/media/infrastructure/utils/PermissionManager.d.ts +6 -0
- package/dist/media/infrastructure/utils/mediaPickerMappers.d.ts +15 -1
- package/dist/molecules/calendar/infrastructure/services/CalendarService.d.ts +1 -0
- package/dist/molecules/calendar/infrastructure/storage/CalendarStore.d.ts +2 -2
- package/dist/molecules/filter-group/FilterGroup.d.ts +1 -1
- package/dist/molecules/navigation/index.d.ts +1 -1
- package/dist/offline/index.d.ts +1 -1
- package/dist/offline/presentation/hooks/useOffline.d.ts +0 -5
- package/dist/tanstack/domain/repositories/BaseRepository.d.ts +5 -1
- package/dist/tanstack/infrastructure/monitoring/DevMonitor.d.ts +1 -0
- package/dist/utils/constants/TimeConstants.d.ts +27 -0
- package/package.json +11 -6
- package/src/atoms/GlassView/GlassView.tsx +0 -2
- package/src/atoms/picker/components/PickerChips.tsx +27 -21
- package/src/core/cache/index.ts +3 -2
- package/src/core/index.ts +5 -3
- package/src/core/repositories/domain/RepositoryUtils.ts +4 -4
- package/src/core/repositories/domain/types.ts +2 -2
- package/src/hooks/index.ts +22 -25
- package/src/image/presentation/components/ImageGallery.tsx +25 -21
- package/src/infinite-scroll/presentation/hooks/useInfiniteScroll.ts +32 -29
- package/src/media/domain/strategies/CameraPickerStrategy.ts +4 -8
- package/src/media/domain/strategies/index.ts +1 -1
- package/src/media/infrastructure/services/MediaPickerService.ts +3 -14
- package/src/media/infrastructure/utils/mediaPickerMappers.ts +29 -6
- package/src/molecules/avatar/AvatarGroup.tsx +137 -62
- package/src/molecules/filter-group/FilterGroup.tsx +31 -22
- package/src/molecules/icon-grid/IconGrid.tsx +52 -20
- package/src/molecules/swipe-actions/domain/entities/SwipeAction.ts +0 -1
- package/src/offline/index.ts +1 -1
- package/src/offline/presentation/hooks/useOffline.ts +0 -8
- package/src/onboarding/presentation/components/BackgroundImageCollage.tsx +32 -23
- package/src/storage/README.md +0 -1
- package/src/storage/cache/domain/types/README.md +0 -1
- package/src/storage/cache/presentation/README.md +0 -1
- package/src/storage/cache/presentation/useCachedValue.ts +12 -2
- package/src/storage/domain/constants/README.md +0 -1
- package/src/storage/infrastructure/adapters/README.md +0 -1
- package/src/storage/presentation/hooks/README.md +0 -6
- package/src/storage/presentation/hooks/useStorageState.ts +13 -4
- package/src/tanstack/domain/repositories/BaseRepository.ts +1 -1
- package/src/theme/hooks/useAppDesignTokens.ts +29 -3
- package/src/timezone/infrastructure/services/TimezoneProvider.ts +2 -2
- package/src/init/index.ts +0 -29
- package/src/layouts/ScreenLayout/index.ts +0 -1
- package/src/layouts/index.ts +0 -5
- package/src/molecules/SearchBar/index.ts +0 -4
- package/src/molecules/StepProgress/index.ts +0 -1
- package/src/molecules/alerts/index.ts +0 -47
- package/src/molecules/bottom-sheet/index.ts +0 -10
- package/src/molecules/circular-menu/index.ts +0 -3
- package/src/molecules/filter-group/index.ts +0 -3
- package/src/molecules/index.ts +0 -38
- package/src/molecules/info-grid/index.ts +0 -3
- package/src/molecules/swipe-actions/index.ts +0 -6
- package/src/presentation/utils/variants/index.ts +0 -6
- package/src/timezone/infrastructure/utils/SimpleCache.ts +0 -64
- package/src/utilities/index.ts +0 -6
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Uses expo-image when available, falls back to React Native Image.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import React, { useMemo } from "react";
|
|
7
|
+
import React, { useCallback, useMemo } from "react";
|
|
8
8
|
import { View, Image as RNImage, StyleSheet, type ImageURISource, type ImageStyle } from "react-native";
|
|
9
9
|
import { useSafeAreaInsets } from "../../../safe-area/hooks/useSafeAreaInsets";
|
|
10
10
|
import {
|
|
@@ -59,7 +59,7 @@ const LAYOUT_GENERATORS: Record<CollageLayout, LayoutGenerator> = {
|
|
|
59
59
|
honeycomb: generateHoneycombLayout,
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
export const BackgroundImageCollage: React.FC<BackgroundImageCollageProps> = ({
|
|
62
|
+
export const BackgroundImageCollage: React.FC<BackgroundImageCollageProps> = React.memo(({
|
|
63
63
|
images,
|
|
64
64
|
layout = "grid",
|
|
65
65
|
columns,
|
|
@@ -75,30 +75,39 @@ export const BackgroundImageCollage: React.FC<BackgroundImageCollageProps> = ({
|
|
|
75
75
|
return generator(images, { columns, gap, borderRadius, safeAreaInsets: insets });
|
|
76
76
|
}, [images, layout, columns, gap, borderRadius, insets]);
|
|
77
77
|
|
|
78
|
+
// Stable key extractor - must be before early return
|
|
79
|
+
const keyExtractor = useCallback((item: ImageLayoutItem) => {
|
|
80
|
+
return typeof item.source === 'string' ? item.source : String(item.source);
|
|
81
|
+
}, []);
|
|
82
|
+
|
|
78
83
|
if (imageLayouts.length === 0) return null;
|
|
79
84
|
|
|
85
|
+
// Memoized image component to prevent unnecessary re-renders
|
|
86
|
+
const CollageImage = React.memo<{ item: ImageLayoutItem }>(({ item }) => {
|
|
87
|
+
if (ExpoImage) {
|
|
88
|
+
return (
|
|
89
|
+
<ExpoImage
|
|
90
|
+
source={item.source}
|
|
91
|
+
style={item.style}
|
|
92
|
+
contentFit="cover"
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
return (
|
|
97
|
+
<RNImage
|
|
98
|
+
source={item.source as ImageURISource | number}
|
|
99
|
+
style={item.style as ImageStyle}
|
|
100
|
+
resizeMode="cover"
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
CollageImage.displayName = 'CollageImage';
|
|
105
|
+
|
|
80
106
|
return (
|
|
81
107
|
<View style={[StyleSheet.absoluteFill, { opacity }]} pointerEvents="none">
|
|
82
|
-
{imageLayouts.map((item) =>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<ExpoImage
|
|
86
|
-
key={String(item.source)}
|
|
87
|
-
source={item.source}
|
|
88
|
-
style={item.style}
|
|
89
|
-
contentFit="cover"
|
|
90
|
-
/>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
return (
|
|
94
|
-
<RNImage
|
|
95
|
-
key={String(item.source)}
|
|
96
|
-
source={item.source as ImageURISource | number}
|
|
97
|
-
style={item.style as ImageStyle}
|
|
98
|
-
resizeMode="cover"
|
|
99
|
-
/>
|
|
100
|
-
);
|
|
101
|
-
})}
|
|
108
|
+
{imageLayouts.map((item) => (
|
|
109
|
+
<CollageImage key={keyExtractor(item)} item={item} />
|
|
110
|
+
))}
|
|
102
111
|
</View>
|
|
103
112
|
);
|
|
104
|
-
};
|
|
113
|
+
});
|
package/src/storage/README.md
CHANGED
|
@@ -118,7 +118,6 @@ Clean Architecture with DDD principles:
|
|
|
118
118
|
- MUST export from index.ts at root level
|
|
119
119
|
- MUST organize exports by module
|
|
120
120
|
- MUST provide TypeScript types
|
|
121
|
-
- MUST maintain backward compatibility
|
|
122
121
|
- MUST not export internal utilities
|
|
123
122
|
|
|
124
123
|
### File Organization
|
|
@@ -103,5 +103,4 @@ TypeScript type definitions for cache entries, configuration, statistics, and ev
|
|
|
103
103
|
### Export Rules
|
|
104
104
|
- MUST export all public types
|
|
105
105
|
- MUST use `type` keyword for type-only exports
|
|
106
|
-
- MUST maintain backward compatibility
|
|
107
106
|
- MUST document type changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* useCachedValue Hook
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { useCallback,
|
|
5
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
import { cacheManager } from '../domain/CacheManager';
|
|
7
7
|
import type { CacheConfig } from '../domain/types/Cache';
|
|
8
8
|
import { useAsyncOperation } from '../../../utils/hooks';
|
|
@@ -16,6 +16,15 @@ export function useCachedValue<T>(
|
|
|
16
16
|
const fetcherRef = useRef(fetcher);
|
|
17
17
|
const configRef = useRef(config);
|
|
18
18
|
|
|
19
|
+
// Update refs when props change
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
fetcherRef.current = fetcher;
|
|
22
|
+
}, [fetcher]);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
configRef.current = config;
|
|
26
|
+
}, [config]);
|
|
27
|
+
|
|
19
28
|
const { data: value, isLoading, error, execute, setData } = useAsyncOperation<T | undefined, Error>(
|
|
20
29
|
async () => {
|
|
21
30
|
const cache = cacheManager.getCache<T>(cacheName, configRef.current);
|
|
@@ -55,8 +64,9 @@ export function useCachedValue<T>(
|
|
|
55
64
|
}, [cacheName, setData]);
|
|
56
65
|
|
|
57
66
|
const refetch = useCallback(() => {
|
|
67
|
+
// Clear data first, then execute on next tick
|
|
58
68
|
setData(undefined);
|
|
59
|
-
execute();
|
|
69
|
+
Promise.resolve().then(() => execute());
|
|
60
70
|
}, [execute, setData]);
|
|
61
71
|
|
|
62
72
|
return useMemo(() => ({
|
|
@@ -84,7 +84,6 @@ Constant values for time-based calculations and default configuration. Located a
|
|
|
84
84
|
- MUST increment CACHE_VERSION on schema changes
|
|
85
85
|
- MUST implement migration for old versions
|
|
86
86
|
- MUST document breaking changes
|
|
87
|
-
- MUST support backward compatibility where possible
|
|
88
87
|
|
|
89
88
|
### Export Rules
|
|
90
89
|
- MUST export all constants
|
|
@@ -137,7 +137,6 @@ Storage adapter implementations for Zustand persist middleware. Located at `src/
|
|
|
137
137
|
- MUST migrate data on read
|
|
138
138
|
- MUST clean up old data after migration
|
|
139
139
|
- MUST handle migration failures
|
|
140
|
-
- MUST be backward compatible
|
|
141
140
|
|
|
142
141
|
### Error Handling
|
|
143
142
|
- MUST catch all exceptions in adapter methods
|
|
@@ -120,9 +120,3 @@ This directory contains React hooks that integrate storage and cache functionali
|
|
|
120
120
|
- MUST use `useMemo` for computed values
|
|
121
121
|
- MUST implement proper dependency arrays
|
|
122
122
|
- MUST avoid unnecessary re-renders
|
|
123
|
-
|
|
124
|
-
### Deprecation
|
|
125
|
-
- MUST document deprecated hooks
|
|
126
|
-
- MUST provide migration path for deprecated hooks
|
|
127
|
-
- MUST maintain backward compatibility when possible
|
|
128
|
-
- MUST remove deprecated hooks after major version bump
|
|
@@ -28,20 +28,29 @@ export const useStorageState = <T>(
|
|
|
28
28
|
const [state, setState] = useState<T>(defaultValue);
|
|
29
29
|
const [isLoading, setIsLoading] = useState(true);
|
|
30
30
|
const isMountedRef = useRef(true);
|
|
31
|
+
const defaultValueRef = useRef(defaultValue);
|
|
32
|
+
|
|
33
|
+
// Update ref when defaultValue changes
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
defaultValueRef.current = defaultValue;
|
|
36
|
+
}, [defaultValue]);
|
|
31
37
|
|
|
32
38
|
useEffect(() => {
|
|
33
39
|
isMountedRef.current = true;
|
|
34
40
|
setIsLoading(true);
|
|
35
41
|
|
|
36
42
|
storageRepository
|
|
37
|
-
.getItem<T>(keyString,
|
|
43
|
+
.getItem<T>(keyString, defaultValueRef.current)
|
|
38
44
|
.then((result) => {
|
|
39
45
|
if (isMountedRef.current) {
|
|
40
|
-
setState(unwrap(result,
|
|
46
|
+
setState(unwrap(result, defaultValueRef.current));
|
|
41
47
|
}
|
|
42
48
|
})
|
|
43
|
-
.catch(() => {
|
|
49
|
+
.catch((error) => {
|
|
44
50
|
// Keep defaultValue on error
|
|
51
|
+
if (__DEV__) {
|
|
52
|
+
console.warn('[useStorageState] Failed to load from storage:', error);
|
|
53
|
+
}
|
|
45
54
|
})
|
|
46
55
|
.finally(() => {
|
|
47
56
|
if (isMountedRef.current) {
|
|
@@ -52,7 +61,7 @@ export const useStorageState = <T>(
|
|
|
52
61
|
return () => {
|
|
53
62
|
isMountedRef.current = false;
|
|
54
63
|
};
|
|
55
|
-
}, [keyString
|
|
64
|
+
}, [keyString]);
|
|
56
65
|
|
|
57
66
|
// Update state and persist to storage
|
|
58
67
|
const updateState = useCallback(
|
|
@@ -79,7 +79,7 @@ export abstract class BaseRepository<
|
|
|
79
79
|
this.resource = resource;
|
|
80
80
|
this.options = mergeRepositoryOptions(options);
|
|
81
81
|
this.keys = createQueryKeyFactory(this.resource);
|
|
82
|
-
this.log = createRepositoryLogger(resource,
|
|
82
|
+
this.log = createRepositoryLogger(resource, __DEV__);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
1
|
+
import { useMemo, useRef } from 'react';
|
|
2
2
|
import { useTheme } from '../infrastructure/stores/themeStore';
|
|
3
3
|
import { createDesignTokens } from '../core/TokenFactory';
|
|
4
4
|
import { useResponsive } from '../../responsive/useResponsive';
|
|
5
5
|
import { type DesignTokens } from '../types/ThemeTypes';
|
|
6
|
+
import type { CustomThemeColors } from '../core/CustomColors';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Shallow equality check for CustomThemeColors
|
|
10
|
+
*/
|
|
11
|
+
function areCustomColorsEqual(a?: CustomThemeColors, b?: CustomThemeColors): boolean {
|
|
12
|
+
if (a === b) return true;
|
|
13
|
+
if (!a || !b) return false;
|
|
14
|
+
|
|
15
|
+
const keysA = Object.keys(a) as (keyof CustomThemeColors)[];
|
|
16
|
+
const keysB = Object.keys(b) as (keyof CustomThemeColors)[];
|
|
17
|
+
|
|
18
|
+
if (keysA.length !== keysB.length) return false;
|
|
19
|
+
|
|
20
|
+
for (const key of keysA) {
|
|
21
|
+
if (a[key] !== b[key]) return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
6
26
|
|
|
7
27
|
/**
|
|
8
28
|
* Hook to access current design tokens (colors, spacing, typography, etc.)
|
|
@@ -13,8 +33,14 @@ export const useAppDesignTokens = (): DesignTokens => {
|
|
|
13
33
|
const { themeMode, customColors } = useTheme();
|
|
14
34
|
const { spacingMultiplier, getFontSize } = useResponsive();
|
|
15
35
|
|
|
36
|
+
// Stabilize customColors reference to prevent unnecessary re-computation
|
|
37
|
+
const customColorsRef = useRef(customColors);
|
|
38
|
+
if (!areCustomColorsEqual(customColorsRef.current, customColors)) {
|
|
39
|
+
customColorsRef.current = customColors;
|
|
40
|
+
}
|
|
41
|
+
|
|
16
42
|
return useMemo(
|
|
17
|
-
() => createDesignTokens(themeMode,
|
|
18
|
-
[themeMode,
|
|
43
|
+
() => createDesignTokens(themeMode, customColorsRef.current, spacingMultiplier, getFontSize),
|
|
44
|
+
[themeMode, spacingMultiplier, getFontSize]
|
|
19
45
|
);
|
|
20
46
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TimezoneInfo } from '../../domain/entities/Timezone';
|
|
2
|
-
import {
|
|
2
|
+
import { UnifiedCache } from '../../../core/cache/domain/UnifiedCache';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* TimezoneProvider
|
|
6
6
|
* Responsible for discovering device timezone and providing available timezones
|
|
7
7
|
*/
|
|
8
8
|
export class TimezoneProvider {
|
|
9
|
-
private cache = new
|
|
9
|
+
private cache = new UnifiedCache<TimezoneInfo[]>({ defaultTTL: 300000 }); // 5 min cache
|
|
10
10
|
/**
|
|
11
11
|
* Get current device timezone using Intl API
|
|
12
12
|
*/
|
package/src/init/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* App Initialization Module
|
|
3
|
-
*
|
|
4
|
-
* Provides utilities for app initialization:
|
|
5
|
-
* - createAppInitializer: Factory for creating app initializers
|
|
6
|
-
* - useAppInitialization: Hook for managing initialization state
|
|
7
|
-
* - createEnvConfig: Environment configuration factory
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// App Initializer
|
|
11
|
-
export {
|
|
12
|
-
createAppInitializer,
|
|
13
|
-
createInitModule,
|
|
14
|
-
} from "./createAppInitializer";
|
|
15
|
-
|
|
16
|
-
// Initialization Hook
|
|
17
|
-
export { useAppInitialization } from "./useAppInitialization";
|
|
18
|
-
|
|
19
|
-
// Environment Configuration
|
|
20
|
-
export * from "./env";
|
|
21
|
-
|
|
22
|
-
// Types
|
|
23
|
-
export type {
|
|
24
|
-
InitModule,
|
|
25
|
-
AppInitializerConfig,
|
|
26
|
-
AppInitializerResult,
|
|
27
|
-
UseAppInitializationOptions,
|
|
28
|
-
UseAppInitializationReturn,
|
|
29
|
-
} from "./types";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ScreenLayout';
|
package/src/layouts/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./StepProgress";
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Alerts Molecule - Public API
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export * from './AlertTypes';
|
|
6
|
-
export { useAlertStore } from './AlertStore';
|
|
7
|
-
export { AlertService } from './AlertService';
|
|
8
|
-
export { AlertBanner } from './AlertBanner';
|
|
9
|
-
export { AlertToast } from './AlertToast';
|
|
10
|
-
export { AlertInline } from './AlertInline';
|
|
11
|
-
export { AlertModal } from './AlertModal';
|
|
12
|
-
export { AlertContainer } from './AlertContainer';
|
|
13
|
-
export { AlertProvider } from './AlertProvider';
|
|
14
|
-
export { useAlert } from './useAlert';
|
|
15
|
-
|
|
16
|
-
import { AlertService } from './AlertService';
|
|
17
|
-
import { useAlertStore } from './AlertStore';
|
|
18
|
-
import { AlertOptions } from './AlertTypes';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Convenience alert service for use outside of components
|
|
22
|
-
*/
|
|
23
|
-
export const alertService = {
|
|
24
|
-
error: (title: string, message?: string, options?: AlertOptions) => {
|
|
25
|
-
const alert = AlertService.createErrorAlert(title, message, options);
|
|
26
|
-
useAlertStore.getState().addAlert(alert);
|
|
27
|
-
return alert.id;
|
|
28
|
-
},
|
|
29
|
-
success: (title: string, message?: string, options?: AlertOptions) => {
|
|
30
|
-
const alert = AlertService.createSuccessAlert(title, message, options);
|
|
31
|
-
useAlertStore.getState().addAlert(alert);
|
|
32
|
-
return alert.id;
|
|
33
|
-
},
|
|
34
|
-
warning: (title: string, message?: string, options?: AlertOptions) => {
|
|
35
|
-
const alert = AlertService.createWarningAlert(title, message, options);
|
|
36
|
-
useAlertStore.getState().addAlert(alert);
|
|
37
|
-
return alert.id;
|
|
38
|
-
},
|
|
39
|
-
info: (title: string, message?: string, options?: AlertOptions) => {
|
|
40
|
-
const alert = AlertService.createInfoAlert(title, message, options);
|
|
41
|
-
useAlertStore.getState().addAlert(alert);
|
|
42
|
-
return alert.id;
|
|
43
|
-
},
|
|
44
|
-
dismiss: (id: string) => {
|
|
45
|
-
useAlertStore.getState().dismissAlert(id);
|
|
46
|
-
},
|
|
47
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './components/BottomSheet';
|
|
2
|
-
export * from './components/BottomSheetModal';
|
|
3
|
-
|
|
4
|
-
export * from './components/filter/FilterBottomSheet';
|
|
5
|
-
export * from './components/filter/FilterSheet';
|
|
6
|
-
export * from './hooks/useBottomSheet';
|
|
7
|
-
export * from './hooks/useBottomSheetModal';
|
|
8
|
-
export * from './hooks/useListFilters';
|
|
9
|
-
export * from './types/BottomSheet';
|
|
10
|
-
export * from './types/Filter';
|
package/src/molecules/index.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Molecules - Composite UI components
|
|
3
|
-
* Built from atoms following atomic design principles
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Component exports
|
|
7
|
-
export * from './avatar';
|
|
8
|
-
export * from './bottom-sheet';
|
|
9
|
-
export { FormField, type FormFieldProps } from './FormField';
|
|
10
|
-
export { ListItem, type ListItemProps } from './ListItem';
|
|
11
|
-
export { SearchBar, type SearchBarProps } from './SearchBar';
|
|
12
|
-
export { IconContainer } from './IconContainer';
|
|
13
|
-
export { BaseModal, type BaseModalProps } from './BaseModal';
|
|
14
|
-
export { ConfirmationModal } from './ConfirmationModalMain';
|
|
15
|
-
export { useConfirmationModal } from './confirmation-modal/useConfirmationModal';
|
|
16
|
-
|
|
17
|
-
// Other components
|
|
18
|
-
export * from './Divider/Divider';
|
|
19
|
-
export * from './Divider/types';
|
|
20
|
-
export * from './StepProgress';
|
|
21
|
-
export * from './List';
|
|
22
|
-
export * from './alerts';
|
|
23
|
-
export * from './calendar';
|
|
24
|
-
export * from './swipe-actions';
|
|
25
|
-
export * from './navigation';
|
|
26
|
-
export * from './long-press-menu';
|
|
27
|
-
export * from './StepHeader';
|
|
28
|
-
export * from './emoji';
|
|
29
|
-
export * from './countdown';
|
|
30
|
-
export * from './splash';
|
|
31
|
-
export * from './filter-group';
|
|
32
|
-
export * from './action-footer/ActionFooter';
|
|
33
|
-
export * from './action-footer/types';
|
|
34
|
-
export * from './hero-section/HeroSection';
|
|
35
|
-
export * from './hero-section/types';
|
|
36
|
-
export * from './info-grid';
|
|
37
|
-
export * from './circular-menu';
|
|
38
|
-
export * from './icon-grid';
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SimpleCache (Backward Compatibility Wrapper)
|
|
3
|
-
*
|
|
4
|
-
* @deprecated Use UnifiedCache from core/cache instead.
|
|
5
|
-
* This wrapper maintains backward compatibility while migrating to UnifiedCache.
|
|
6
|
-
*
|
|
7
|
-
* Lightweight in-memory cache for performance optimization.
|
|
8
|
-
* Now implemented using UnifiedCache with timeout-based cleanup strategy.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { UnifiedCache } from '../../../core/cache/domain/UnifiedCache';
|
|
12
|
-
import { TimeoutCleanupStrategy } from '../../../core/cache/domain/CleanupStrategy';
|
|
13
|
-
import { ONE_MINUTE_MS } from '../../../utils/constants/TimeConstants';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* SimpleCache - Wrapper around UnifiedCache for backward compatibility
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* // Old usage (still works):
|
|
21
|
-
* const cache = new SimpleCache<string>(60000);
|
|
22
|
-
*
|
|
23
|
-
* // New usage (recommended):
|
|
24
|
-
* import { CacheFactory } from '../../../core/cache';
|
|
25
|
-
* const cache = CacheFactory.createTimeoutCache(60000);
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export class SimpleCache<T> {
|
|
29
|
-
private cache: UnifiedCache<T>;
|
|
30
|
-
|
|
31
|
-
constructor(defaultTTL: number = ONE_MINUTE_MS) {
|
|
32
|
-
this.cache = new UnifiedCache<T>({
|
|
33
|
-
defaultTTL,
|
|
34
|
-
cleanupStrategy: new TimeoutCleanupStrategy(ONE_MINUTE_MS),
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Destroy the cache and stop cleanup timer
|
|
40
|
-
*/
|
|
41
|
-
destroy(): void {
|
|
42
|
-
this.cache.destroy();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
set(key: string, value: T, ttl?: number): void {
|
|
46
|
-
this.cache.set(key, value, ttl);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
get(key: string): T | undefined {
|
|
50
|
-
return this.cache.get(key);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
has(key: string): boolean {
|
|
54
|
-
return this.cache.has(key);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
clear(): void {
|
|
58
|
-
this.cache.clear();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
delete(key: string): void {
|
|
62
|
-
this.cache.delete(key);
|
|
63
|
-
}
|
|
64
|
-
}
|