@umituz/react-native-design-system 4.29.1 → 4.29.2
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/atoms/icon/iconStore.d.ts +2 -0
- package/dist/atoms/icon/index.d.ts +1 -1
- package/dist/theme/infrastructure/providers/DesignSystemProvider.d.ts +9 -0
- package/package.json +1 -1
- package/src/atoms/icon/iconStore.ts +32 -0
- package/src/theme/infrastructure/providers/DesignSystemProvider.tsx +3 -3
|
@@ -58,6 +58,8 @@ interface IconStore {
|
|
|
58
58
|
reset: () => void;
|
|
59
59
|
}
|
|
60
60
|
export declare const useIconStore: import("zustand").UseBoundStore<import("zustand").StoreApi<IconStore>>;
|
|
61
|
+
export declare const iconStore: import("zustand").UseBoundStore<import("zustand").StoreApi<IconStore>>;
|
|
62
|
+
export declare const DEFAULT_ICON_NAMES: IconNames;
|
|
61
63
|
/**
|
|
62
64
|
* Get icon renderer
|
|
63
65
|
*/
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* - Icon name normalization and caching
|
|
9
9
|
*/
|
|
10
10
|
export { AtomicIcon, type AtomicIconProps, type IconSize, type IconName, type IconColor, } from './AtomicIcon';
|
|
11
|
-
export { useIconStore, useIconRenderer, useIconName, useHasIconConfig, type IconNames, type IconRenderer, type IconRenderProps, REQUIRED_ICON_KEYS, } from './iconStore';
|
|
11
|
+
export { useIconStore, useIconRenderer, useIconName, useHasIconConfig, iconStore, DEFAULT_ICON_NAMES, type IconNames, type IconRenderer, type IconRenderProps, REQUIRED_ICON_KEYS, } from './iconStore';
|
|
12
12
|
export { type IconSizePreset, ICON_SIZES, getIconSize, isIconSizePreset, } from './AtomicIcon.types';
|
|
@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import type { ThemeMode } from '../../core/ColorPalette';
|
|
3
3
|
import type { CustomThemeColors } from '../../core/CustomColors';
|
|
4
4
|
import type { SplashScreenProps } from '../../../molecules/splash/types';
|
|
5
|
+
import { type IconNames } from '../../../atoms/icon/iconStore';
|
|
5
6
|
interface DesignSystemProviderProps {
|
|
6
7
|
children: ReactNode;
|
|
7
8
|
customColors?: CustomThemeColors;
|
|
@@ -12,6 +13,14 @@ interface DesignSystemProviderProps {
|
|
|
12
13
|
loadingComponent?: ReactNode;
|
|
13
14
|
onInitialized?: () => void;
|
|
14
15
|
onError?: (error: unknown) => void;
|
|
16
|
+
/** Icon names available in the app (defaults to standard set) */
|
|
17
|
+
iconNames?: IconNames;
|
|
18
|
+
/** Icon renderer function from @umituz/react-native-icons or similar */
|
|
19
|
+
iconRenderer?: (props: {
|
|
20
|
+
name: string;
|
|
21
|
+
size: number;
|
|
22
|
+
color: string;
|
|
23
|
+
}) => React.ReactNode;
|
|
15
24
|
}
|
|
16
25
|
export declare const DesignSystemProvider: React.FC<DesignSystemProviderProps>;
|
|
17
26
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "4.29.
|
|
3
|
+
"version": "4.29.2",
|
|
4
4
|
"description": "Universal design system for React Native apps with safe navigation hooks - updated SKILL.md with navigation documentation",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -91,6 +91,38 @@ export const useIconStore = create<IconStore>()((set) => ({
|
|
|
91
91
|
reset: () => set({ iconNames: null, iconRenderer: null, isConfigured: false }),
|
|
92
92
|
}));
|
|
93
93
|
|
|
94
|
+
// Alias for backward compatibility
|
|
95
|
+
export const iconStore = useIconStore;
|
|
96
|
+
|
|
97
|
+
// Default icon names for fallback
|
|
98
|
+
export const DEFAULT_ICON_NAMES: IconNames = {
|
|
99
|
+
close: 'x',
|
|
100
|
+
check: 'check',
|
|
101
|
+
checkCircle: 'check-circle',
|
|
102
|
+
chevronLeft: 'chevron-left',
|
|
103
|
+
chevronRight: 'chevron-right',
|
|
104
|
+
chevronUp: 'chevron-up',
|
|
105
|
+
chevronDown: 'chevron-down',
|
|
106
|
+
arrowLeft: 'arrow-left',
|
|
107
|
+
arrowRight: 'arrow-right',
|
|
108
|
+
search: 'search',
|
|
109
|
+
closeCircle: 'x-circle',
|
|
110
|
+
clock: 'clock',
|
|
111
|
+
refresh: 'refresh-cw',
|
|
112
|
+
alertCircle: 'alert-circle',
|
|
113
|
+
star: 'star',
|
|
114
|
+
starOutline: 'star-outline',
|
|
115
|
+
wifi: 'wifi',
|
|
116
|
+
wifiOff: 'wifi-off',
|
|
117
|
+
info: 'info',
|
|
118
|
+
trash: 'trash',
|
|
119
|
+
calendar: 'calendar',
|
|
120
|
+
swap: 'swap',
|
|
121
|
+
colorFilter: 'filter',
|
|
122
|
+
diamond: 'diamond',
|
|
123
|
+
award: 'award',
|
|
124
|
+
};
|
|
125
|
+
|
|
94
126
|
/**
|
|
95
127
|
* Get icon renderer
|
|
96
128
|
*/
|
|
@@ -8,7 +8,7 @@ import type { ThemeMode } from '../../core/ColorPalette';
|
|
|
8
8
|
import type { CustomThemeColors } from '../../core/CustomColors';
|
|
9
9
|
import type { SplashScreenProps } from '../../../molecules/splash/types';
|
|
10
10
|
import { FIVE_SECONDS_MS } from '../../../utils/constants/TimeConstants';
|
|
11
|
-
import { iconStore, DEFAULT_ICON_NAMES } from '../../../atoms/icon/iconStore';
|
|
11
|
+
import { iconStore, DEFAULT_ICON_NAMES, type IconNames } from '../../../atoms/icon/iconStore';
|
|
12
12
|
|
|
13
13
|
// Lazy load SplashScreen to avoid circular dependency
|
|
14
14
|
const SplashScreen = lazy(() => import('../../../molecules/splash').then(m => ({ default: m.SplashScreen })));
|
|
@@ -26,7 +26,7 @@ interface DesignSystemProviderProps {
|
|
|
26
26
|
onInitialized?: () => void;
|
|
27
27
|
onError?: (error: unknown) => void;
|
|
28
28
|
/** Icon names available in the app (defaults to standard set) */
|
|
29
|
-
iconNames?:
|
|
29
|
+
iconNames?: IconNames;
|
|
30
30
|
/** Icon renderer function from @umituz/react-native-icons or similar */
|
|
31
31
|
iconRenderer?: (props: { name: string; size: number; color: string }) => React.ReactNode;
|
|
32
32
|
}
|
|
@@ -111,7 +111,7 @@ export const DesignSystemProvider: React.FC<DesignSystemProviderProps> = ({
|
|
|
111
111
|
// Configure icon renderer if provided
|
|
112
112
|
useEffect(() => {
|
|
113
113
|
if (iconRenderer) {
|
|
114
|
-
iconStore.setConfig(iconNames || DEFAULT_ICON_NAMES, iconRenderer);
|
|
114
|
+
iconStore.getState().setConfig(iconNames || DEFAULT_ICON_NAMES, iconRenderer);
|
|
115
115
|
}
|
|
116
116
|
}, [iconRenderer, iconNames]);
|
|
117
117
|
|