@qwickapps/react-framework 1.5.6 β 1.5.7
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/components/QwickApp.d.ts.map +1 -1
- package/dist/contexts/NavigationContext.d.ts.map +1 -1
- package/dist/hooks/useBaseProps.d.ts +12 -1161
- package/dist/hooks/useBaseProps.d.ts.map +1 -1
- package/dist/index.esm.js +387 -232
- package/dist/index.js +385 -230
- package/dist/palettes/manifest.json +19 -19
- package/dist/palettes/palette-autumn.1.4.9.css +172 -0
- package/dist/palettes/palette-autumn.1.4.9.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.0.css +172 -0
- package/dist/palettes/palette-autumn.1.5.0.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.1.css +172 -0
- package/dist/palettes/palette-autumn.1.5.1.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.2.css +172 -0
- package/dist/palettes/palette-autumn.1.5.2.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.3.css +172 -0
- package/dist/palettes/palette-autumn.1.5.3.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.4.css +172 -0
- package/dist/palettes/palette-autumn.1.5.4.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.5.css +172 -0
- package/dist/palettes/palette-autumn.1.5.5.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.7.css +172 -0
- package/dist/palettes/palette-autumn.1.5.7.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.4.9.css +172 -0
- package/dist/palettes/palette-cosmic.1.4.9.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.0.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.0.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.1.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.1.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.2.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.2.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.3.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.3.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.4.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.4.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.5.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.5.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.7.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.7.min.css +1 -0
- package/dist/palettes/palette-default.1.4.9.css +178 -0
- package/dist/palettes/palette-default.1.4.9.min.css +1 -0
- package/dist/palettes/palette-default.1.5.0.css +178 -0
- package/dist/palettes/palette-default.1.5.0.min.css +1 -0
- package/dist/palettes/palette-default.1.5.1.css +178 -0
- package/dist/palettes/palette-default.1.5.1.min.css +1 -0
- package/dist/palettes/palette-default.1.5.2.css +178 -0
- package/dist/palettes/palette-default.1.5.2.min.css +1 -0
- package/dist/palettes/palette-default.1.5.3.css +178 -0
- package/dist/palettes/palette-default.1.5.3.min.css +1 -0
- package/dist/palettes/palette-default.1.5.4.css +178 -0
- package/dist/palettes/palette-default.1.5.4.min.css +1 -0
- package/dist/palettes/palette-default.1.5.5.css +178 -0
- package/dist/palettes/palette-default.1.5.5.min.css +1 -0
- package/dist/palettes/palette-default.1.5.7.css +178 -0
- package/dist/palettes/palette-default.1.5.7.min.css +1 -0
- package/dist/palettes/palette-ocean.1.4.9.css +172 -0
- package/dist/palettes/palette-ocean.1.4.9.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.0.css +172 -0
- package/dist/palettes/palette-ocean.1.5.0.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.1.css +172 -0
- package/dist/palettes/palette-ocean.1.5.1.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.2.css +172 -0
- package/dist/palettes/palette-ocean.1.5.2.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.3.css +172 -0
- package/dist/palettes/palette-ocean.1.5.3.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.4.css +172 -0
- package/dist/palettes/palette-ocean.1.5.4.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.5.css +172 -0
- package/dist/palettes/palette-ocean.1.5.5.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.7.css +172 -0
- package/dist/palettes/palette-ocean.1.5.7.min.css +1 -0
- package/dist/palettes/palette-spring.1.4.9.css +160 -0
- package/dist/palettes/palette-spring.1.4.9.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.0.css +160 -0
- package/dist/palettes/palette-spring.1.5.0.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.1.css +160 -0
- package/dist/palettes/palette-spring.1.5.1.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.2.css +160 -0
- package/dist/palettes/palette-spring.1.5.2.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.3.css +166 -0
- package/dist/palettes/palette-spring.1.5.3.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.4.css +166 -0
- package/dist/palettes/palette-spring.1.5.4.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.5.css +166 -0
- package/dist/palettes/palette-spring.1.5.5.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.7.css +166 -0
- package/dist/palettes/palette-spring.1.5.7.min.css +1 -0
- package/dist/palettes/palette-winter.1.4.9.css +172 -0
- package/dist/palettes/palette-winter.1.4.9.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.0.css +172 -0
- package/dist/palettes/palette-winter.1.5.0.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.1.css +172 -0
- package/dist/palettes/palette-winter.1.5.1.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.2.css +172 -0
- package/dist/palettes/palette-winter.1.5.2.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.3.css +172 -0
- package/dist/palettes/palette-winter.1.5.3.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.4.css +172 -0
- package/dist/palettes/palette-winter.1.5.4.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.5.css +172 -0
- package/dist/palettes/palette-winter.1.5.5.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.7.css +172 -0
- package/dist/palettes/palette-winter.1.5.7.min.css +1 -0
- package/dist/utils/iconMap.d.ts +21 -8
- package/dist/utils/iconMap.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/utils/iconMap.test.tsx +197 -0
- package/src/components/QwickApp.tsx +8 -1
- package/src/contexts/NavigationContext.tsx +21 -15
- package/src/utils/iconMap.tsx +209 -153
package/src/utils/iconMap.tsx
CHANGED
|
@@ -1,81 +1,101 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Icon Mapping Utility
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Provides centralized icon mapping for both Material-UI components and emoji representations.
|
|
5
5
|
* Used across the framework for consistent icon rendering in buttons, navigation, admin UI, etc.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Static map for commonly used icons with emoji support
|
|
9
|
+
* - Fallback to HelpOutline icon for unmapped icons (with console warning)
|
|
10
|
+
* - Runtime icon registration via registerIcon() for app-specific icons
|
|
11
|
+
*
|
|
7
12
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
13
|
*/
|
|
9
14
|
|
|
10
15
|
import React from 'react';
|
|
16
|
+
|
|
17
|
+
// Material UI Icons - sorted alphabetically
|
|
11
18
|
import {
|
|
19
|
+
AccountCircle,
|
|
20
|
+
Add,
|
|
21
|
+
Architecture,
|
|
22
|
+
ArrowBack,
|
|
23
|
+
ArrowForward,
|
|
12
24
|
Article,
|
|
13
|
-
|
|
25
|
+
AttachMoney,
|
|
26
|
+
Autorenew,
|
|
27
|
+
Block,
|
|
14
28
|
Book,
|
|
15
|
-
|
|
29
|
+
Business,
|
|
30
|
+
Check,
|
|
31
|
+
CheckCircle,
|
|
32
|
+
Close,
|
|
33
|
+
Cloud,
|
|
16
34
|
CloudDownload,
|
|
17
35
|
CloudUpload,
|
|
36
|
+
Code,
|
|
18
37
|
Computer,
|
|
19
|
-
|
|
38
|
+
Construction,
|
|
20
39
|
Dashboard,
|
|
40
|
+
Delete,
|
|
41
|
+
Download,
|
|
42
|
+
Edit,
|
|
43
|
+
Email,
|
|
44
|
+
Explore,
|
|
45
|
+
Favorite,
|
|
46
|
+
Group,
|
|
47
|
+
Help,
|
|
48
|
+
HelpOutline,
|
|
49
|
+
Home,
|
|
21
50
|
Info,
|
|
51
|
+
InsertPhoto,
|
|
52
|
+
IntegrationInstructions,
|
|
22
53
|
Inventory,
|
|
23
54
|
Inventory2,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
55
|
+
Key,
|
|
56
|
+
Layers,
|
|
57
|
+
LibraryBooks,
|
|
58
|
+
LocalOffer,
|
|
59
|
+
Lock,
|
|
60
|
+
LockOpen,
|
|
61
|
+
Login,
|
|
62
|
+
Logout,
|
|
63
|
+
ManageAccounts,
|
|
64
|
+
Memory,
|
|
32
65
|
Menu,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
66
|
+
Notifications,
|
|
67
|
+
People,
|
|
68
|
+
Person,
|
|
69
|
+
PersonSearch,
|
|
70
|
+
Phone,
|
|
71
|
+
PhotoLibrary,
|
|
72
|
+
PlayArrow,
|
|
73
|
+
Psychology,
|
|
74
|
+
Refresh,
|
|
75
|
+
Rocket,
|
|
76
|
+
RotateRight,
|
|
77
|
+
Route,
|
|
37
78
|
Save,
|
|
79
|
+
Search,
|
|
80
|
+
Security,
|
|
38
81
|
Send,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Group,
|
|
43
|
-
Business,
|
|
82
|
+
Settings,
|
|
83
|
+
Share,
|
|
84
|
+
Shield,
|
|
44
85
|
ShoppingCart,
|
|
45
86
|
Speed,
|
|
87
|
+
Star,
|
|
88
|
+
Storage,
|
|
46
89
|
SupportAgent,
|
|
90
|
+
Sync,
|
|
91
|
+
TrendingUp,
|
|
47
92
|
Tune,
|
|
48
|
-
|
|
49
|
-
Lock,
|
|
50
|
-
LockOpen,
|
|
93
|
+
VerifiedUser,
|
|
51
94
|
Visibility,
|
|
52
95
|
VisibilityOff,
|
|
53
|
-
// New icons for seed content
|
|
54
|
-
Psychology,
|
|
55
|
-
Autorenew,
|
|
56
|
-
Code,
|
|
57
|
-
IntegrationInstructions,
|
|
58
|
-
Construction,
|
|
59
|
-
Work,
|
|
60
|
-
Layers,
|
|
61
|
-
TrendingUp,
|
|
62
|
-
Route,
|
|
63
|
-
Sync,
|
|
64
|
-
Architecture,
|
|
65
|
-
Security,
|
|
66
|
-
VerifiedUser,
|
|
67
|
-
// Additional icons for control panels and admin UIs
|
|
68
96
|
VpnKey,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
ManageAccounts,
|
|
72
|
-
Storage,
|
|
73
|
-
Refresh,
|
|
74
|
-
Block,
|
|
75
|
-
CheckCircle,
|
|
76
|
-
RotateRight,
|
|
77
|
-
Memory,
|
|
78
|
-
LocalOffer,
|
|
97
|
+
Work,
|
|
98
|
+
WorkspacePremium,
|
|
79
99
|
} from '@mui/icons-material';
|
|
80
100
|
|
|
81
101
|
/**
|
|
@@ -87,140 +107,175 @@ export interface IconMapping {
|
|
|
87
107
|
}
|
|
88
108
|
|
|
89
109
|
/**
|
|
90
|
-
* Centralized icon registry mapping icon names to their representations
|
|
91
|
-
*
|
|
110
|
+
* Centralized icon registry mapping icon names to their representations.
|
|
111
|
+
* Sorted alphabetically by category, then by key within each category.
|
|
112
|
+
*
|
|
113
|
+
* For icons not in this map, getIconComponent() will return a HelpOutline fallback
|
|
114
|
+
* and log a warning. Use registerIcon() to add app-specific icons at runtime.
|
|
92
115
|
*/
|
|
93
116
|
export const iconMap: Record<string, IconMapping> = {
|
|
94
|
-
//
|
|
95
|
-
home: { emoji: 'π ', component: Home },
|
|
96
|
-
menu: { emoji: 'β°', component: Menu },
|
|
97
|
-
dashboard: { emoji: 'π', component: Dashboard },
|
|
98
|
-
|
|
99
|
-
// Information & Help
|
|
100
|
-
info: { emoji: 'βΉοΈ', component: Info },
|
|
101
|
-
about: { emoji: 'βΉοΈ', component: Info },
|
|
102
|
-
help: { emoji: 'β', component: Help },
|
|
103
|
-
book: { emoji: 'π', component: Book },
|
|
104
|
-
|
|
105
|
-
// Communication
|
|
106
|
-
email: { emoji: 'π§', component: Email },
|
|
107
|
-
contact: { emoji: 'π§', component: Email },
|
|
108
|
-
phone: { emoji: 'π±', component: Phone },
|
|
109
|
-
send: { emoji: 'π€', component: Send },
|
|
110
|
-
|
|
111
|
-
// Actions
|
|
117
|
+
// === Actions ===
|
|
112
118
|
add: { emoji: 'β', component: Add },
|
|
113
|
-
edit: { emoji: 'βοΈ', component: Edit },
|
|
114
|
-
delete: { emoji: 'ποΈ', component: Delete },
|
|
115
|
-
save: { emoji: 'πΎ', component: Save },
|
|
116
119
|
check: { emoji: 'β', component: Check },
|
|
120
|
+
check_circle: { emoji: 'β
', component: CheckCircle },
|
|
117
121
|
close: { emoji: 'β', component: Close },
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
// Content
|
|
122
|
+
delete: { emoji: 'ποΈ', component: Delete },
|
|
123
|
+
edit: { emoji: 'βοΈ', component: Edit },
|
|
124
|
+
refresh: { emoji: 'π', component: Refresh },
|
|
125
|
+
rotate_right: { emoji: 'π', component: RotateRight },
|
|
126
|
+
save: { emoji: 'πΎ', component: Save },
|
|
124
127
|
search: { emoji: 'π', component: Search },
|
|
128
|
+
send: { emoji: 'π€', component: Send },
|
|
125
129
|
share: { emoji: 'π', component: Share },
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
person: { emoji: 'π€', component: Person },
|
|
132
|
-
user: { emoji: 'π€', component: Person },
|
|
133
|
-
group: { emoji: 'π₯', component: Group },
|
|
134
|
-
favorite: { emoji: 'β€οΈ', component: Favorite },
|
|
135
|
-
star: { emoji: 'β', component: Star },
|
|
136
|
-
verified_user: { emoji: 'β
', component: VerifiedUser },
|
|
137
|
-
|
|
138
|
-
// Business
|
|
139
|
-
business: { emoji: 'π’', component: Business },
|
|
140
|
-
shoppingcart: { emoji: 'π', component: ShoppingCart },
|
|
141
|
-
cart: { emoji: 'π', component: ShoppingCart },
|
|
142
|
-
attachmoney: { emoji: 'π°', component: AttachMoney },
|
|
143
|
-
|
|
144
|
-
// Security
|
|
130
|
+
sync: { emoji: 'π', component: Sync },
|
|
131
|
+
|
|
132
|
+
// === Authentication & Security ===
|
|
133
|
+
block: { emoji: 'π«', component: Block },
|
|
134
|
+
key: { emoji: 'π', component: Key },
|
|
145
135
|
lock: { emoji: 'π', component: Lock },
|
|
146
|
-
|
|
136
|
+
lock_open: { emoji: 'π', component: LockOpen },
|
|
137
|
+
lockopen: { emoji: 'π', component: LockOpen }, // alias
|
|
138
|
+
login: { emoji: 'π', component: Login },
|
|
139
|
+
logout: { emoji: 'πͺ', component: Logout },
|
|
140
|
+
security: { emoji: 'π', component: Security },
|
|
141
|
+
shield: { emoji: 'π‘οΈ', component: Shield },
|
|
142
|
+
verified_user: { emoji: 'β
', component: VerifiedUser },
|
|
147
143
|
visibility: { emoji: 'ποΈ', component: Visibility },
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
144
|
+
visibility_off: { emoji: 'π', component: VisibilityOff },
|
|
145
|
+
visibilityoff: { emoji: 'π', component: VisibilityOff }, // alias
|
|
146
|
+
vpn_key: { emoji: 'π', component: VpnKey },
|
|
147
|
+
|
|
148
|
+
// === Business & Commerce ===
|
|
149
|
+
attach_money: { emoji: 'π°', component: AttachMoney },
|
|
150
|
+
attachmoney: { emoji: 'π°', component: AttachMoney }, // alias
|
|
151
|
+
business: { emoji: 'π’', component: Business },
|
|
152
|
+
cart: { emoji: 'π', component: ShoppingCart }, // alias
|
|
153
|
+
shopping_cart: { emoji: 'π', component: ShoppingCart },
|
|
154
|
+
shoppingcart: { emoji: 'π', component: ShoppingCart }, // alias
|
|
155
|
+
work: { emoji: 'πΌ', component: Work },
|
|
156
|
+
workspace_premium: { emoji: 'β', component: WorkspacePremium },
|
|
157
|
+
|
|
158
|
+
// === Communication ===
|
|
159
|
+
contact: { emoji: 'π§', component: Email }, // alias
|
|
160
|
+
email: { emoji: 'π§', component: Email },
|
|
161
|
+
mail: { emoji: 'π§', component: Email }, // alias
|
|
162
|
+
notifications: { emoji: 'π', component: Notifications },
|
|
163
|
+
phone: { emoji: 'π±', component: Phone },
|
|
165
164
|
support_agent: { emoji: 'ποΈ', component: SupportAgent },
|
|
166
|
-
tune: { emoji: 'ποΈ', component: Tune },
|
|
167
165
|
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
// === Content & Media ===
|
|
167
|
+
article: { emoji: 'π°', component: Article },
|
|
168
|
+
blog: { emoji: 'π', component: Book }, // alias
|
|
169
|
+
book: { emoji: 'π', component: Book },
|
|
170
|
+
gallery: { emoji: 'πΌοΈ', component: InsertPhoto }, // alias
|
|
171
|
+
image: { emoji: 'πΌοΈ', component: InsertPhoto },
|
|
172
|
+
insert_photo: { emoji: 'πΌοΈ', component: InsertPhoto },
|
|
173
|
+
library_books: { emoji: 'π', component: LibraryBooks },
|
|
174
|
+
news: { emoji: 'π°', component: Article }, // alias
|
|
175
|
+
photo_library: { emoji: 'πΈ', component: PhotoLibrary },
|
|
176
|
+
play: { emoji: 'βΆοΈ', component: PlayArrow }, // alias
|
|
177
|
+
play_arrow: { emoji: 'βΆοΈ', component: PlayArrow },
|
|
178
|
+
portfolio: { emoji: 'πΌ', component: Business }, // alias
|
|
179
|
+
|
|
180
|
+
// === Development & Technology ===
|
|
181
|
+
architecture: { emoji: 'ποΈ', component: Architecture },
|
|
171
182
|
autorenew: { emoji: 'π', component: Autorenew },
|
|
172
|
-
|
|
183
|
+
cloud: { emoji: 'βοΈ', component: Cloud },
|
|
184
|
+
cloud_download: { emoji: 'βοΈβ¬οΈ', component: CloudDownload },
|
|
185
|
+
cloud_upload: { emoji: 'βοΈβ¬οΈ', component: CloudUpload },
|
|
186
|
+
clouddownload: { emoji: 'βοΈβ¬οΈ', component: CloudDownload }, // alias
|
|
187
|
+
cloudupload: { emoji: 'βοΈβ¬οΈ', component: CloudUpload }, // alias
|
|
188
|
+
code: { emoji: 'π»', component: Code },
|
|
189
|
+
computer: { emoji: 'π»', component: Computer },
|
|
173
190
|
construction: { emoji: 'π§', component: Construction },
|
|
174
|
-
|
|
191
|
+
integration_instructions: { emoji: 'π', component: IntegrationInstructions },
|
|
192
|
+
memory: { emoji: 'π§ ', component: Memory },
|
|
193
|
+
psychology: { emoji: 'π§ ', component: Psychology },
|
|
194
|
+
rocket: { emoji: 'π', component: Rocket },
|
|
195
|
+
storage: { emoji: 'πΎ', component: Storage },
|
|
196
|
+
|
|
197
|
+
// === Navigation & Layout ===
|
|
198
|
+
arrow_back: { emoji: 'β', component: ArrowBack },
|
|
199
|
+
arrow_forward: { emoji: 'β', component: ArrowForward },
|
|
200
|
+
arrowback: { emoji: 'β', component: ArrowBack }, // alias
|
|
201
|
+
arrowforward: { emoji: 'β', component: ArrowForward }, // alias
|
|
202
|
+
dashboard: { emoji: 'π', component: Dashboard },
|
|
203
|
+
download: { emoji: 'β¬οΈ', component: Download },
|
|
204
|
+
explore: { emoji: 'π§', component: Explore },
|
|
205
|
+
home: { emoji: 'π ', component: Home },
|
|
175
206
|
layers: { emoji: 'π', component: Layers },
|
|
176
|
-
|
|
207
|
+
menu: { emoji: 'β°', component: Menu },
|
|
177
208
|
route: { emoji: 'πΊοΈ', component: Route },
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
209
|
+
settings: { emoji: 'βοΈ', component: Settings },
|
|
210
|
+
trending_up: { emoji: 'π', component: TrendingUp },
|
|
211
|
+
tune: { emoji: 'ποΈ', component: Tune },
|
|
181
212
|
|
|
182
|
-
//
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
person_search: { emoji: 'π', component: PersonSearch },
|
|
186
|
-
manage_accounts: { emoji: 'π₯', component: ManageAccounts },
|
|
187
|
-
storage: { emoji: 'πΎ', component: Storage },
|
|
188
|
-
refresh: { emoji: 'π', component: Refresh },
|
|
189
|
-
block: { emoji: 'π«', component: Block },
|
|
190
|
-
check_circle: { emoji: 'β
', component: CheckCircle },
|
|
191
|
-
rotate_right: { emoji: 'π', component: RotateRight },
|
|
192
|
-
memory: { emoji: 'π§ ', component: Memory },
|
|
213
|
+
// === Products & Inventory ===
|
|
214
|
+
inventory: { emoji: 'π¦', component: Inventory },
|
|
215
|
+
inventory_2: { emoji: 'π¦', component: Inventory2 },
|
|
193
216
|
local_offer: { emoji: 'π·οΈ', component: LocalOffer },
|
|
217
|
+
products: { emoji: 'ποΈ', component: ShoppingCart }, // alias
|
|
218
|
+
services: { emoji: 'βοΈ', component: Settings }, // alias
|
|
219
|
+
speed: { emoji: 'β‘', component: Speed },
|
|
220
|
+
|
|
221
|
+
// === Status & Feedback ===
|
|
222
|
+
about: { emoji: 'βΉοΈ', component: Info }, // alias
|
|
223
|
+
favorite: { emoji: 'β€οΈ', component: Favorite },
|
|
224
|
+
heart: { emoji: 'β€οΈ', component: Favorite }, // alias
|
|
225
|
+
help: { emoji: 'β', component: Help },
|
|
226
|
+
info: { emoji: 'βΉοΈ', component: Info },
|
|
227
|
+
star: { emoji: 'β', component: Star },
|
|
228
|
+
|
|
229
|
+
// === Users & People ===
|
|
230
|
+
account_circle: { emoji: 'π€', component: AccountCircle },
|
|
231
|
+
group: { emoji: 'π₯', component: Group },
|
|
232
|
+
manage_accounts: { emoji: 'π€', component: ManageAccounts },
|
|
233
|
+
people: { emoji: 'π₯', component: People },
|
|
234
|
+
person: { emoji: 'π€', component: Person },
|
|
235
|
+
person_search: { emoji: 'π', component: PersonSearch },
|
|
236
|
+
user: { emoji: 'π€', component: Person }, // alias
|
|
237
|
+
users: { emoji: 'π₯', component: People }, // alias
|
|
194
238
|
};
|
|
195
239
|
|
|
196
240
|
/**
|
|
197
241
|
* Get emoji representation of an icon
|
|
198
|
-
* @param iconName - Icon name (case-insensitive)
|
|
242
|
+
* @param iconName - Icon name (case-insensitive, supports snake_case)
|
|
199
243
|
* @param fallback - Fallback emoji if icon not found (default: π)
|
|
200
244
|
* @returns Emoji string
|
|
201
245
|
*/
|
|
202
246
|
export function getIconEmoji(iconName: string | undefined, fallback: string = 'π'): string {
|
|
203
247
|
if (!iconName) return fallback;
|
|
204
|
-
const
|
|
205
|
-
|
|
248
|
+
const normalized = iconName.toLowerCase();
|
|
249
|
+
const mapping = iconMap[normalized];
|
|
250
|
+
return mapping?.emoji || fallback;
|
|
206
251
|
}
|
|
207
252
|
|
|
208
253
|
/**
|
|
209
|
-
* Get Material-UI component representation of an icon
|
|
210
|
-
*
|
|
211
|
-
*
|
|
254
|
+
* Get Material-UI component representation of an icon.
|
|
255
|
+
*
|
|
256
|
+
* Uses the static iconMap for known icons. For unmapped icons,
|
|
257
|
+
* returns a HelpOutline fallback and logs a warning.
|
|
258
|
+
*
|
|
259
|
+
* @param iconName - Icon name (case-insensitive, supports snake_case)
|
|
260
|
+
* @returns React element (mapped icon or HelpOutline fallback), or null if no name provided
|
|
212
261
|
*/
|
|
213
262
|
export function getIconComponent(iconName: string | undefined): React.ReactElement | null {
|
|
214
263
|
if (!iconName) return null;
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
264
|
+
|
|
265
|
+
const normalized = iconName.toLowerCase();
|
|
266
|
+
const mapping = iconMap[normalized];
|
|
267
|
+
|
|
268
|
+
if (mapping?.component) {
|
|
269
|
+
const IconComponent = mapping.component;
|
|
270
|
+
return <IconComponent />;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Fallback: Return HelpOutline icon and warn about unmapped icon
|
|
274
|
+
// Use registerIcon() to add app-specific icons at runtime
|
|
275
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
276
|
+
console.warn(`[IconMap] Icon "${iconName}" not found. Add it to iconMap or use registerIcon().`);
|
|
220
277
|
}
|
|
221
|
-
|
|
222
|
-
const IconComponent = mapping.component;
|
|
223
|
-
return <IconComponent />;
|
|
278
|
+
return <HelpOutline />;
|
|
224
279
|
}
|
|
225
280
|
|
|
226
281
|
/**
|
|
@@ -232,14 +287,15 @@ export function registerIcon(name: string, mapping: IconMapping): void {
|
|
|
232
287
|
}
|
|
233
288
|
|
|
234
289
|
/**
|
|
235
|
-
* Check if an icon is registered
|
|
290
|
+
* Check if an icon is registered in the static map
|
|
291
|
+
* If false, getIconComponent will return HelpOutline fallback
|
|
236
292
|
*/
|
|
237
293
|
export function hasIcon(iconName: string): boolean {
|
|
238
294
|
return iconName.toLowerCase() in iconMap;
|
|
239
295
|
}
|
|
240
296
|
|
|
241
297
|
/**
|
|
242
|
-
* Get all registered icon names
|
|
298
|
+
* Get all registered icon names from the static map
|
|
243
299
|
*/
|
|
244
300
|
export function getRegisteredIcons(): string[] {
|
|
245
301
|
return Object.keys(iconMap);
|