@umituz/react-native-design-system 1.1.3 → 1.3.0

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/README.md CHANGED
@@ -1,17 +1,19 @@
1
1
  # @umituz/react-native-design-system
2
2
 
3
- Universal design system for React Native apps following Domain-Driven Design (DDD) architecture with Material Design 3 components.
3
+ Universal design system for React Native apps following Domain-Driven Design (DDD) architecture with Material Design 3 principles.
4
4
 
5
5
  ## âœĻ Features
6
6
 
7
7
  - ðŸŽĻ **Material Design 3** - Modern, accessible UI components
8
- - ⚛ïļ **Atomic Design** - Organized component hierarchy (Atoms → Molecules → Organisms)
9
- - 🏗ïļ **DDD Architecture** - Clean domain-driven structure
8
+ - ⚛ïļ **Pure React Native** - No external UI library dependencies (lightweight!)
9
+ - 🏗ïļ **Atomic Design** - Organized component hierarchy (Atoms → Molecules → Organisms)
10
+ - 🧎 **DDD Architecture** - Clean domain-driven structure
10
11
  - 🌓 **Theme Support** - Built-in light/dark mode
11
12
  - ðŸ“ą **Responsive** - Adaptive layouts for phones and tablets
12
13
  - â™ŋ **Accessible** - WCAG AA compliant components
13
14
  - 🎭 **Animations** - Smooth React Native Reanimated animations
14
15
  - ðŸ“Ķ **Zero Config** - Works out of the box
16
+ - ðŸŠķ **Lightweight** - Smaller bundle size (no Paper dependency)
15
17
 
16
18
  ## ðŸ“Ķ Installation
17
19
 
@@ -22,9 +24,11 @@ npm install @umituz/react-native-design-system
22
24
  ### Peer Dependencies
23
25
 
24
26
  ```bash
25
- npm install react@18.3.1 react-native@0.76.3 react-native-paper@^5.12.5 react-native-reanimated@~3.10.1
27
+ npm install react@18.3.1 react-native@0.76.3 react-native-reanimated@~3.10.1 lucide-react-native@^0.468.0
26
28
  ```
27
29
 
30
+ > **v1.3.0 Breaking Change**: React Native Paper dependency removed! All components now use pure React Native implementation for lighter bundle size and full control over styling.
31
+
28
32
  ## 🚀 Usage
29
33
 
30
34
  ```typescript
@@ -60,11 +64,12 @@ const MyScreen = () => {
60
64
  ## ðŸ§Đ Components
61
65
 
62
66
  ### Atoms (Primitive UI Components)
63
- - `AtomicButton` - Material Design 3 buttons with variants
64
- - `AtomicText` - Typography with MD3 type scale
65
- - `AtomicInput` - Text inputs with validation
66
- - `AtomicCard` - Container cards
67
- - `AtomicIcon` - Icon components
67
+ - `AtomicButton` - Pure React Native buttons with variants (primary, secondary, outline, text, danger)
68
+ - `AtomicText` - Typography with MD3 type scale (pure RN Text)
69
+ - `AtomicInput` - Text inputs with validation states (pure RN TextInput)
70
+ - `AtomicTextArea` - Multiline inputs with character counter (pure RN TextInput)
71
+ - `AtomicCard` - Container cards with elevation (pure RN View)
72
+ - `AtomicIcon` - Lucide icons with 1,639 icons
68
73
  - `AtomicSwitch` - Toggle switches
69
74
  - `AtomicBadge` - Status badges
70
75
  - `AtomicProgress` - Progress indicators
@@ -79,9 +84,9 @@ const MyScreen = () => {
79
84
  - And more...
80
85
 
81
86
  ### Organisms (Complex Patterns)
82
- - `ScreenLayout` - Screen wrapper with safe area
87
+ - `ScreenLayout` - Screen wrapper with safe area (pure RN View)
83
88
  - `AppHeader` - Application header
84
- - `FormContainer` - Form layout container
89
+ - `FormContainer` - Form layout container with keyboard handling (pure RN View + ScrollView)
85
90
 
86
91
  ## ðŸŽĻ Design Tokens
87
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "1.1.3",
3
+ "version": "1.3.0",
4
4
  "description": "Universal design system for React Native apps - Domain-Driven Design architecture with Material Design 3 components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -27,7 +27,6 @@
27
27
  "peerDependencies": {
28
28
  "react": ">=18.2.0",
29
29
  "react-native": ">=0.74.0",
30
- "react-native-paper": "^5.12.5",
31
30
  "react-native-reanimated": "~3.10.1",
32
31
  "@react-native-community/datetimepicker": "8.0.1",
33
32
  "@expo/vector-icons": "^14.0.0",
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Icon Library Configuration
3
+ *
4
+ * 🔧 SINGLE SOURCE OF TRUTH FOR ICON LIBRARY SELECTION
5
+ *
6
+ * To change icon library:
7
+ * 1. Update package.json with new library
8
+ * 2. Change CURRENT_LIBRARY below
9
+ * 3. Create adapter if needed (infrastructure/adapters/)
10
+ * 4. Done! All apps automatically use new library
11
+ *
12
+ * @example
13
+ * // Switch to Material Icons:
14
+ * export const CURRENT_LIBRARY: IconLibraryType = 'material';
15
+ */
16
+
17
+ export type IconLibraryType = 'lucide' | 'material' | 'fontawesome' | 'ionicons';
18
+
19
+ /**
20
+ * 🔧 CHANGE THIS TO SWITCH ICON LIBRARY
21
+ */
22
+ export const CURRENT_LIBRARY: IconLibraryType = 'lucide';
23
+
24
+ /**
25
+ * Icon Library Configuration
26
+ */
27
+ export const ICON_LIBRARY_CONFIG = {
28
+ /**
29
+ * Current icon library in use
30
+ */
31
+ library: CURRENT_LIBRARY,
32
+
33
+ /**
34
+ * Default icon size (in pixels)
35
+ */
36
+ defaultSize: 24,
37
+
38
+ /**
39
+ * Default stroke width for outline icons
40
+ */
41
+ defaultStrokeWidth: 2,
42
+
43
+ /**
44
+ * Library metadata
45
+ */
46
+ libraries: {
47
+ lucide: {
48
+ name: 'Lucide',
49
+ package: 'lucide-react-native',
50
+ version: '^0.468.0',
51
+ iconCount: 1639,
52
+ type: 'outline',
53
+ adapter: 'LucideAdapter',
54
+ },
55
+ material: {
56
+ name: 'Material Icons',
57
+ package: '@expo/vector-icons',
58
+ version: '^14.0.0',
59
+ iconCount: 2000,
60
+ type: 'filled',
61
+ adapter: 'MaterialAdapter',
62
+ },
63
+ fontawesome: {
64
+ name: 'Font Awesome',
65
+ package: '@expo/vector-icons',
66
+ version: '^14.0.0',
67
+ iconCount: 1500,
68
+ type: 'solid',
69
+ adapter: 'FontAwesomeAdapter',
70
+ },
71
+ ionicons: {
72
+ name: 'Ionicons',
73
+ package: '@expo/vector-icons',
74
+ version: '^14.0.0',
75
+ iconCount: 1300,
76
+ type: 'outline',
77
+ adapter: 'IoniconsAdapter',
78
+ },
79
+ },
80
+ } as const;
81
+
82
+ /**
83
+ * Get current library metadata
84
+ */
85
+ export const getCurrentLibrary = () => {
86
+ return ICON_LIBRARY_CONFIG.libraries[CURRENT_LIBRARY];
87
+ };
88
+
89
+ /**
90
+ * Type-safe library check
91
+ * Factory uses Lucide icons only
92
+ */
93
+ export const isLucideLibrary = () => true;
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Icons Domain - Entities
3
+ *
4
+ * Core icon types and interfaces for the App Factory.
5
+ * Provides unified access to Lucide icons (design-system) + Expo vector icons.
6
+ *
7
+ * @domain icons
8
+ * @layer domain
9
+ */
10
+
11
+ /**
12
+ * Icon library types
13
+ * - lucide: Lucide React Native icons (already in design-system/AtomicIcon)
14
+ * - material: Material Design icons (@expo/vector-icons)
15
+ * - fontawesome: FontAwesome icons (@expo/vector-icons)
16
+ * - ionicons: Ionicons (@expo/vector-icons)
17
+ */
18
+ export enum IconLibrary {
19
+ LUCIDE = 'lucide',
20
+ MATERIAL = 'material',
21
+ FONTAWESOME = 'fontawesome',
22
+ IONICONS = 'ionicons',
23
+ }
24
+
25
+ /**
26
+ * Icon category for organization
27
+ */
28
+ export enum IconCategory {
29
+ ALL = 'all',
30
+ NAVIGATION = 'navigation',
31
+ ACTION = 'action',
32
+ SOCIAL = 'social',
33
+ COMMUNICATION = 'communication',
34
+ MEDIA = 'media',
35
+ BUSINESS = 'business',
36
+ WEATHER = 'weather',
37
+ SYMBOLS = 'symbols',
38
+ EMOJI = 'emoji',
39
+ }
40
+
41
+ /**
42
+ * Icon metadata for registry
43
+ */
44
+ export interface IconMetadata {
45
+ name: string;
46
+ library: IconLibrary;
47
+ category: IconCategory;
48
+ tags: string[];
49
+ searchTerms: string[];
50
+ }
51
+
52
+ /**
53
+ * Icon registry interface
54
+ */
55
+ export interface IIconRegistry {
56
+ /**
57
+ * Get all icons in the library
58
+ */
59
+ getAllIcons(): IconMetadata[];
60
+
61
+ /**
62
+ * Get icons by category
63
+ */
64
+ getIconsByCategory(category: IconCategory): IconMetadata[];
65
+
66
+ /**
67
+ * Search icons by query
68
+ */
69
+ searchIcons(query: string): IconMetadata[];
70
+
71
+ /**
72
+ * Get icon metadata by name
73
+ */
74
+ getIconMetadata(name: string): IconMetadata | null;
75
+ }
76
+
77
+ /**
78
+ * Icon picker configuration
79
+ */
80
+ export interface IconPickerConfig {
81
+ libraries: IconLibrary[];
82
+ categories: IconCategory[];
83
+ showSearch: boolean;
84
+ multiSelect: boolean;
85
+ maxSelections?: number;
86
+ onSelect: (icons: IconMetadata[]) => void;
87
+ onCancel?: () => void;
88
+ }
89
+
90
+ /**
91
+ * Icon constants
92
+ */
93
+ export const ICON_CONSTANTS = {
94
+ DEFAULT_SIZE: 24,
95
+ DEFAULT_COLOR: 'onSurface',
96
+ DEFAULT_LIBRARY: IconLibrary.LUCIDE,
97
+ MAX_SEARCH_RESULTS: 50,
98
+ } as const;
99
+
100
+ /**
101
+ * Icon utility functions
102
+ */
103
+ export const IconUtils = {
104
+ /**
105
+ * Normalize icon name for search
106
+ */
107
+ normalizeIconName: (name: string): string => {
108
+ return name.toLowerCase().replace(/[^a-z0-9]/g, '');
109
+ },
110
+
111
+ /**
112
+ * Match search query against icon metadata
113
+ */
114
+ matchesSearch: (icon: IconMetadata, query: string): boolean => {
115
+ const normalizedQuery = IconUtils.normalizeIconName(query);
116
+ const normalizedName = IconUtils.normalizeIconName(icon.name);
117
+ const normalizedTags = icon.tags.map(tag => IconUtils.normalizeIconName(tag));
118
+ const normalizedTerms = icon.searchTerms.map(term => IconUtils.normalizeIconName(term));
119
+
120
+ return (
121
+ normalizedName.includes(normalizedQuery) ||
122
+ normalizedTags.some(tag => tag.includes(normalizedQuery)) ||
123
+ normalizedTerms.some(term => term.includes(normalizedQuery))
124
+ );
125
+ },
126
+
127
+ /**
128
+ * Filter icons by category
129
+ */
130
+ filterByCategory: (icons: IconMetadata[], category: IconCategory): IconMetadata[] => {
131
+ if (category === IconCategory.ALL) {
132
+ return icons;
133
+ }
134
+ return icons.filter(icon => icon.category === category);
135
+ },
136
+
137
+ /**
138
+ * Sort icons alphabetically
139
+ */
140
+ sortByName: (icons: IconMetadata[]): IconMetadata[] => {
141
+ return [...icons].sort((a, b) => a.name.localeCompare(b.name));
142
+ },
143
+ };
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Icon Adapter Interface
3
+ *
4
+ * Universal interface that all icon library adapters must implement.
5
+ * This allows seamless switching between icon libraries.
6
+ *
7
+ * @example
8
+ * // Implementing for a new library:
9
+ * export const MyLibraryAdapter: IIconAdapter = {
10
+ * getIconComponent: (name) => MyIcons[name],
11
+ * getIconSize: (size) => sizeMap[size],
12
+ * getIconColor: (color, tokens) => colorMap[color],
13
+ * getAllIcons: () => Object.keys(MyIcons),
14
+ * };
15
+ */
16
+
17
+ import type { DesignTokens } from '@umituz/react-native-design-system';
18
+
19
+ export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
20
+ export type IconColor =
21
+ | 'primary'
22
+ | 'secondary'
23
+ | 'success'
24
+ | 'warning'
25
+ | 'error'
26
+ | 'info'
27
+ | 'onSurface'
28
+ | 'surfaceVariant'
29
+ | 'onPrimary'
30
+ | 'onSecondary'
31
+ | 'textInverse';
32
+
33
+ /**
34
+ * Icon Adapter Interface
35
+ * All icon library adapters must implement this interface
36
+ */
37
+ export interface IIconAdapter {
38
+ /**
39
+ * Get the icon component for a given icon name
40
+ * @param name - Icon name (library-specific)
41
+ * @returns Icon component or null if not found
42
+ */
43
+ getIconComponent: (name: string) => any | null;
44
+
45
+ /**
46
+ * Convert semantic size to pixel size
47
+ * @param size - Semantic size (xs, sm, md, lg, xl, xxl)
48
+ * @param customSize - Optional custom pixel size
49
+ * @returns Pixel size
50
+ */
51
+ getIconSize: (size: IconSize, customSize?: number) => number;
52
+
53
+ /**
54
+ * Convert semantic color to hex color
55
+ * @param color - Semantic color name
56
+ * @param tokens - Design tokens for theme colors
57
+ * @param customColor - Optional custom hex color
58
+ * @returns Hex color string
59
+ */
60
+ getIconColor: (
61
+ color: IconColor,
62
+ tokens: DesignTokens,
63
+ customColor?: string
64
+ ) => string;
65
+
66
+ /**
67
+ * Get all available icon names for this library
68
+ * @returns Array of icon names
69
+ */
70
+ getAllIcons: () => string[];
71
+
72
+ /**
73
+ * Check if an icon exists in the library
74
+ * @param name - Icon name to check
75
+ * @returns True if icon exists
76
+ */
77
+ hasIcon: (name: string) => boolean;
78
+
79
+ /**
80
+ * Get default stroke width for outline icons
81
+ * @returns Stroke width number
82
+ */
83
+ getStrokeWidth?: () => number;
84
+ }
85
+
86
+ /**
87
+ * Icon Props - Universal props for Icon component
88
+ */
89
+ export interface IconProps {
90
+ /**
91
+ * Icon name (library-specific)
92
+ */
93
+ name: string;
94
+
95
+ /**
96
+ * Icon size preset
97
+ */
98
+ size?: IconSize;
99
+
100
+ /**
101
+ * Custom pixel size (overrides size preset)
102
+ */
103
+ customSize?: number;
104
+
105
+ /**
106
+ * Semantic color
107
+ */
108
+ color?: IconColor;
109
+
110
+ /**
111
+ * Custom hex color (overrides semantic color)
112
+ */
113
+ customColor?: string;
114
+
115
+ /**
116
+ * Stroke width for outline icons
117
+ */
118
+ strokeWidth?: number;
119
+
120
+ /**
121
+ * Background circle for icon
122
+ */
123
+ withBackground?: boolean;
124
+
125
+ /**
126
+ * Background color
127
+ */
128
+ backgroundColor?: string;
129
+
130
+ /**
131
+ * Accessibility label
132
+ */
133
+ accessibilityLabel?: string;
134
+
135
+ /**
136
+ * Test ID
137
+ */
138
+ testID?: string;
139
+
140
+ /**
141
+ * Custom styles
142
+ */
143
+ style?: any;
144
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Icons Domain - Centralized Icon System
3
+ *
4
+ * ðŸŽŊ SINGLE SOURCE OF TRUTH FOR ALL ICONS
5
+ *
6
+ * Universal icon library system with easy library switching.
7
+ * Change icon library = change one config file!
8
+ *
9
+ * @domain icons
10
+ * @enabled true (All apps)
11
+ *
12
+ * ARCHITECTURE:
13
+ * ```
14
+ * domains/icons/
15
+ * ├── domain/
16
+ * │ ├── config/
17
+ * │ │ └── IconLibraryConfig.ts 🔧 Change library here!
18
+ * │ └── interfaces/
19
+ * │ └── IIconAdapter.ts Interface for adapters
20
+ * ├── infrastructure/
21
+ * │ └── adapters/
22
+ * │ ├── LucideAdapter.ts Current: Lucide (1,639 icons)
23
+ * │ ├── MaterialAdapter.ts Future: Material Icons
24
+ * │ └── FontAwesomeAdapter.ts Future: Font Awesome
25
+ * └── presentation/
26
+ * └── components/
27
+ * └── Icon.tsx Universal Icon component
28
+ * ```
29
+ *
30
+ * USAGE:
31
+ * ```typescript
32
+ * import { Icon } from '@domains/icons';
33
+ *
34
+ * // Basic usage
35
+ * <Icon name="Settings" size="md" color="primary" />
36
+ *
37
+ * // Custom size and color
38
+ * <Icon name="Heart" customSize={32} customColor="#FF0000" />
39
+ *
40
+ * // With background
41
+ * <Icon name="Info" size="lg" withBackground backgroundColor="#667eea" />
42
+ * ```
43
+ *
44
+ * 🔧 TO CHANGE ICON LIBRARY:
45
+ *
46
+ * Step 1: Update package.json
47
+ * ```json
48
+ * {
49
+ * "dependencies": {
50
+ * "new-icon-library": "^1.0.0"
51
+ * }
52
+ * }
53
+ * ```
54
+ *
55
+ * Step 2: Change CURRENT_LIBRARY in domain/config/IconLibraryConfig.ts
56
+ * ```typescript
57
+ * export const CURRENT_LIBRARY: IconLibraryType = 'material'; // Changed!
58
+ * ```
59
+ *
60
+ * Step 3: Create adapter (if needed)
61
+ * ```typescript
62
+ * // infrastructure/adapters/MaterialAdapter.ts
63
+ * export const MaterialAdapter: IIconAdapter = {
64
+ * getIconComponent: (name) => MaterialIcons[name],
65
+ * // ... implement interface
66
+ * };
67
+ * ```
68
+ *
69
+ * Step 4: Done! All apps use new library automatically ✅
70
+ *
71
+ * CURRENT LIBRARY: Lucide (1,639 icons)
72
+ * @see https://lucide.dev/icons/
73
+ *
74
+ * DEPENDENCIES:
75
+ * - lucide-react-native: ^0.468.0 (Current library)
76
+ */
77
+
78
+ // ============================================================================
79
+ // PRESENTATION LAYER - Universal Icon Component
80
+ // ============================================================================
81
+
82
+ export { Icon } from './presentation/components/Icon';
83
+ export type {
84
+ IconProps,
85
+ IconSize,
86
+ IconColor,
87
+ IconName,
88
+ } from './presentation/components/Icon';
89
+
90
+ // ============================================================================
91
+ // DOMAIN LAYER - Configuration & Interfaces
92
+ // ============================================================================
93
+
94
+ export {
95
+ CURRENT_LIBRARY,
96
+ ICON_LIBRARY_CONFIG,
97
+ getCurrentLibrary,
98
+ isLucideLibrary,
99
+ } from './domain/config/IconLibraryConfig';
100
+ export type { IconLibraryType } from './domain/config/IconLibraryConfig';
101
+
102
+ export type { IIconAdapter } from './domain/interfaces/IIconAdapter';
103
+
104
+ // ============================================================================
105
+ // INFRASTRUCTURE LAYER - Adapters
106
+ // ============================================================================
107
+
108
+ export { LucideAdapter } from './infrastructure/adapters/LucideAdapter';
109
+ export type { LucideIconName } from './infrastructure/adapters/LucideAdapter';
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Lucide Icon Library Adapter
3
+ *
4
+ * Adapter for lucide-react-native library (1,639 icons).
5
+ * Implements IIconAdapter interface for seamless library switching.
6
+ *
7
+ * @library lucide-react-native
8
+ * @version ^0.468.0
9
+ * @icons 1,639
10
+ * @type outline
11
+ *
12
+ * @see https://lucide.dev/icons/
13
+ */
14
+
15
+ import { icons } from 'lucide-react-native';
16
+ import type { IIconAdapter, IconSize, IconColor } from '../../domain/interfaces/IIconAdapter';
17
+ import type { DesignTokens } from '@umituz/react-native-design-system';
18
+
19
+ /**
20
+ * Size mapping: Semantic → Pixels
21
+ */
22
+ const SIZE_MAP: Record<IconSize, number> = {
23
+ xs: 16,
24
+ sm: 20,
25
+ md: 24,
26
+ lg: 28,
27
+ xl: 32,
28
+ xxl: 40,
29
+ };
30
+
31
+ /**
32
+ * Lucide Adapter Implementation
33
+ */
34
+ export const LucideAdapter: IIconAdapter = {
35
+ /**
36
+ * Get Lucide icon component by name
37
+ */
38
+ getIconComponent: (name: string) => {
39
+ const IconComponent = icons[name as keyof typeof icons];
40
+ if (!IconComponent) {
41
+ console.warn(`[LucideAdapter] Icon "${name}" not found in Lucide library`);
42
+ return null;
43
+ }
44
+ return IconComponent;
45
+ },
46
+
47
+ /**
48
+ * Get icon size in pixels
49
+ */
50
+ getIconSize: (size: IconSize, customSize?: number) => {
51
+ return customSize || SIZE_MAP[size];
52
+ },
53
+
54
+ /**
55
+ * Get icon color from theme
56
+ */
57
+ getIconColor: (color: IconColor, tokens: DesignTokens, customColor?: string) => {
58
+ if (customColor) return customColor;
59
+
60
+ const colorMap: Record<IconColor, string> = {
61
+ primary: tokens.colors.primary,
62
+ secondary: tokens.colors.secondary,
63
+ success: tokens.colors.success,
64
+ warning: tokens.colors.warning,
65
+ error: tokens.colors.error,
66
+ info: tokens.colors.info,
67
+ onSurface: tokens.colors.onSurface,
68
+ surfaceVariant: tokens.colors.surfaceVariant,
69
+ onPrimary: tokens.colors.onPrimary,
70
+ onSecondary: tokens.colors.onSecondary,
71
+ textInverse: tokens.colors.textInverse,
72
+ };
73
+
74
+ return colorMap[color];
75
+ },
76
+
77
+ /**
78
+ * Get all available Lucide icon names
79
+ */
80
+ getAllIcons: () => {
81
+ return Object.keys(icons);
82
+ },
83
+
84
+ /**
85
+ * Check if icon exists in Lucide library
86
+ */
87
+ hasIcon: (name: string) => {
88
+ return name in icons;
89
+ },
90
+
91
+ /**
92
+ * Default stroke width for Lucide outline icons
93
+ */
94
+ getStrokeWidth: () => 2,
95
+ };
96
+
97
+ /**
98
+ * Lucide icon names type (for TypeScript autocomplete)
99
+ */
100
+ export type LucideIconName = keyof typeof icons;