@umituz/react-native-design-system 2.1.3 → 2.1.5

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": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -105,4 +105,4 @@
105
105
  "README.md",
106
106
  "LICENSE"
107
107
  ]
108
- }
108
+ }
@@ -25,7 +25,7 @@
25
25
 
26
26
  import React, { useMemo } from 'react';
27
27
  import { View, ScrollView, StyleSheet, ViewStyle } from 'react-native';
28
- import { SafeAreaView, Edge } from 'react-native-safe-area-context';
28
+ import { SafeAreaView, type Edge } from 'react-native-safe-area-context';
29
29
  import { useAppDesignTokens } from '../theme';
30
30
 
31
31
  /**
@@ -6,7 +6,7 @@
6
6
  import React, { createContext, useContext } from 'react';
7
7
  import {
8
8
  SafeAreaProvider as NativeSafeAreaProvider,
9
- SafeAreaProviderProps as NativeSafeAreaProviderProps,
9
+ type SafeAreaProviderProps as NativeSafeAreaProviderProps,
10
10
  } from 'react-native-safe-area-context';
11
11
  import { DEFAULT_CONFIG } from '../constants';
12
12
 
@@ -19,6 +19,7 @@ export interface SafeAreaConfig {
19
19
  }
20
20
 
21
21
  export interface SafeAreaProviderProps extends NativeSafeAreaProviderProps {
22
+ children?: React.ReactNode;
22
23
  config?: SafeAreaConfig;
23
24
  }
24
25
 
@@ -0,0 +1,27 @@
1
+ import { useMemo } from 'react';
2
+ import { useDesignSystemTheme } from '../infrastructure/globalThemeStore';
3
+ import { createDesignTokens, type DesignTokens } from '../core/TokenFactory';
4
+
5
+ /**
6
+ * Hook to access current design tokens (colors, spacing, typography, etc.)
7
+ *
8
+ * This hook is the primary way for components to access theme tokens.
9
+ * It automatically updates when the theme mode or custom colors change
10
+ * in the design system global store.
11
+ *
12
+ * @returns {DesignTokens} The current design tokens
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * const tokens = useAppDesignTokens();
17
+ * return <View style={{ backgroundColor: tokens.colors.backgroundPrimary }} />;
18
+ * ```
19
+ */
20
+ export const useAppDesignTokens = (): DesignTokens => {
21
+ const { themeMode, customColors } = useDesignSystemTheme();
22
+
23
+ return useMemo(
24
+ () => createDesignTokens(themeMode, customColors),
25
+ [themeMode, customColors]
26
+ );
27
+ };
@@ -53,16 +53,3 @@ export function useThemedStyleSheet<T extends NamedStyles<T>>(
53
53
  [theme, styleFactory],
54
54
  );
55
55
  }
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-