@asteby/metacore-runtime-react 49.10.0 → 49.12.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +40 -0
  3. package/dist/column-filter-field.d.ts +21 -0
  4. package/dist/column-filter-field.d.ts.map +1 -0
  5. package/dist/column-filter-field.js +51 -0
  6. package/dist/dialogs/dynamic-record.d.ts +5 -2
  7. package/dist/dialogs/dynamic-record.d.ts.map +1 -1
  8. package/dist/dialogs/dynamic-record.js +96 -14
  9. package/dist/dynamic-columns.d.ts.map +1 -1
  10. package/dist/dynamic-columns.js +11 -1
  11. package/dist/dynamic-form.d.ts.map +1 -1
  12. package/dist/dynamic-form.js +10 -2
  13. package/dist/dynamic-icon.d.ts +16 -1
  14. package/dist/dynamic-icon.d.ts.map +1 -1
  15. package/dist/dynamic-icon.js +36 -5
  16. package/dist/dynamic-multi-select-field.d.ts +13 -1
  17. package/dist/dynamic-multi-select-field.d.ts.map +1 -1
  18. package/dist/dynamic-multi-select-field.js +19 -4
  19. package/dist/dynamic-table.d.ts.map +1 -1
  20. package/dist/dynamic-table.js +2 -1
  21. package/dist/field-widget-registry.d.ts +35 -0
  22. package/dist/field-widget-registry.d.ts.map +1 -0
  23. package/dist/field-widget-registry.js +66 -0
  24. package/dist/icon-aliases.d.ts +2 -0
  25. package/dist/icon-aliases.d.ts.map +1 -0
  26. package/dist/icon-aliases.js +594 -0
  27. package/dist/icon-resolvers.d.ts +13 -0
  28. package/dist/icon-resolvers.d.ts.map +1 -0
  29. package/dist/icon-resolvers.js +36 -0
  30. package/dist/icon-spec.d.ts +17 -0
  31. package/dist/icon-spec.d.ts.map +1 -0
  32. package/dist/icon-spec.js +165 -0
  33. package/dist/index.d.ts +4 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +4 -0
  36. package/dist/types.d.ts +1 -1
  37. package/dist/types.d.ts.map +1 -1
  38. package/package.json +1 -1
  39. package/src/__tests__/column-filter-field.test.ts +105 -0
  40. package/src/__tests__/dynamic-record-field-types.test.tsx +221 -0
  41. package/src/__tests__/field-widget-registry.test.tsx +165 -0
  42. package/src/__tests__/icon-component.test.tsx +145 -0
  43. package/src/__tests__/icon-spec.test.ts +155 -0
  44. package/src/column-filter-field.ts +66 -0
  45. package/src/dialogs/dynamic-record.tsx +145 -13
  46. package/src/dynamic-columns.tsx +22 -1
  47. package/src/dynamic-form.tsx +12 -1
  48. package/src/dynamic-icon.tsx +68 -3
  49. package/src/dynamic-multi-select-field.tsx +29 -4
  50. package/src/dynamic-table.tsx +2 -1
  51. package/src/field-widget-registry.tsx +98 -0
  52. package/src/icon-aliases.ts +602 -0
  53. package/src/icon-resolvers.ts +59 -0
  54. package/src/icon-spec.ts +169 -0
  55. package/src/index.ts +12 -0
  56. package/src/types.ts +3 -0
@@ -0,0 +1,602 @@
1
+ // Alias table FontAwesome (5/6) -> Lucide slug (kebab, as in
2
+ // `lucide-react/dynamicIconImports`). Keys are the FontAwesome name WITHOUT the
3
+ // `fa-` prefix and without style (`fas`/`far`/`fa-solid`...): "fas fa-brain" ->
4
+ // "brain". Values are Lucide glyphs that exist (a test checks every entry
5
+ // against the installed lucide-react).
6
+ //
7
+ // Names that already match a Lucide glyph (`eye`, `heart`, `bone`...) need no
8
+ // entry: the parser tries the FontAwesome name against Lucide directly. The
9
+ // table is for names that differ, and for the ones doctores.lat stores in its
10
+ // database (specialties, services, categories). Lucide ships no brand logos
11
+ // (github, twitter...), so brands only map to a generic neighbour here; a host
12
+ // that needs the real logo registers a resolver (`registerIconResolver`).
13
+ export const FONT_AWESOME_ALIASES: Readonly<Record<string, string>> = {
14
+ // --- Medicine / health ---
15
+ 'user-md': 'stethoscope',
16
+ 'user-doctor': 'stethoscope',
17
+ 'user-nurse': 'user-round-plus',
18
+ 'user-injured': 'user-round-x',
19
+ 'hospital-alt': 'hospital',
20
+ 'hospital-user': 'hospital',
21
+ 'hospital-symbol': 'hospital',
22
+ 'clinic-medical': 'hospital',
23
+ 'house-medical': 'house-plus',
24
+ 'house-chimney-medical': 'house-plus',
25
+ 'heartbeat': 'heart-pulse',
26
+ 'heart-pulse': 'heart-pulse',
27
+ 'heart-circle-plus': 'heart-plus',
28
+ 'shield-heart': 'shield-plus',
29
+ 'notes-medical': 'notebook-pen',
30
+ 'file-medical': 'file-plus',
31
+ 'file-medical-alt': 'file-heart',
32
+ 'file-waveform': 'file-heart',
33
+ 'file-prescription': 'file-heart',
34
+ 'file-invoice': 'file-text',
35
+ 'file-invoice-dollar': 'receipt',
36
+ 'file-alt': 'file-text',
37
+ 'file-lines': 'file-text',
38
+ 'prescription': 'file-heart',
39
+ 'prescription-bottle': 'pill-bottle',
40
+ 'prescription-bottle-alt': 'pill-bottle',
41
+ 'prescription-bottle-medical': 'pill-bottle',
42
+ 'capsules': 'pill',
43
+ 'pills': 'pill',
44
+ 'tablets': 'tablets',
45
+ 'syringe': 'syringe',
46
+ 'vial': 'test-tube',
47
+ 'vials': 'test-tubes',
48
+ 'flask-vial': 'flask-conical',
49
+ 'flask': 'flask-conical',
50
+ 'microscope': 'microscope',
51
+ 'dna': 'dna',
52
+ 'x-ray': 'scan',
53
+ 'xray': 'scan',
54
+ 'radiation': 'radiation',
55
+ 'procedures': 'bed',
56
+ 'bed-pulse': 'bed',
57
+ 'diagnoses': 'scan-heart',
58
+ 'head-side-virus': 'virus',
59
+ 'head-side-cough': 'wind',
60
+ 'head-side-mask': 'shield-plus',
61
+ 'viruses': 'virus',
62
+ 'bacteria': 'bug',
63
+ 'bacterium': 'bug',
64
+ 'disease': 'virus',
65
+ 'lungs': 'wind',
66
+ 'lungs-virus': 'wind',
67
+ 'tooth': 'toothbrush',
68
+ 'teeth': 'toothbrush',
69
+ 'teeth-open': 'toothbrush',
70
+ 'allergies': 'flower-2',
71
+ 'hand-holding-medical': 'hand-heart',
72
+ 'hand-holding-heart': 'hand-heart',
73
+ 'hands-helping': 'hand-helping',
74
+ 'hand-holding-hand': 'hand-helping',
75
+ 'hand-sparkles': 'sparkles',
76
+ 'hands-wash': 'droplets',
77
+ 'pump-soap': 'droplets',
78
+ 'soap': 'droplets',
79
+ 'first-aid': 'cross',
80
+ 'plus-square': 'square-plus',
81
+ 'square-plus': 'square-plus',
82
+ 'medkit': 'cross',
83
+ 'kit-medical': 'cross',
84
+ 'briefcase-medical': 'briefcase',
85
+ 'band-aid': 'bandage',
86
+ 'bandage': 'bandage',
87
+ 'crutch': 'accessibility',
88
+ 'wheelchair': 'accessibility',
89
+ 'wheelchair-move': 'accessibility',
90
+ 'blind': 'eye-off',
91
+ 'low-vision': 'eye-off',
92
+ 'glasses': 'glasses',
93
+ 'deaf': 'ear-off',
94
+ 'assistive-listening-systems': 'ear',
95
+ 'ear-listen': 'ear',
96
+ 'ear-deaf': 'ear-off',
97
+ 'weight': 'scale',
98
+ 'weight-scale': 'scale',
99
+ 'balance-scale': 'scale',
100
+ 'scale-balanced': 'scale',
101
+ 'thermometer-half': 'thermometer',
102
+ 'temperature-high': 'thermometer-sun',
103
+ 'temperature-low': 'thermometer-snowflake',
104
+ 'cannabis': 'leaf',
105
+ 'smoking': 'cigarette',
106
+ 'smoking-ban': 'cigarette-off',
107
+ 'pager': 'radio',
108
+ 'stretcher': 'bed-single',
109
+ 'user-clock': 'clock',
110
+ 'ribbon': 'ribbon',
111
+ 'heart-broken': 'heart-crack',
112
+ 'heart-crack': 'heart-crack',
113
+ 'baby-carriage': 'baby',
114
+ 'child': 'baby',
115
+ 'child-reaching': 'baby',
116
+ 'person-pregnant': 'baby',
117
+ 'pregnant': 'baby',
118
+ 'female': 'venus',
119
+ 'woman': 'venus',
120
+ 'person-dress': 'venus',
121
+ 'male': 'mars',
122
+ 'man': 'mars',
123
+ 'person': 'person-standing',
124
+ 'venus-mars': 'venus-and-mars',
125
+ 'genderless': 'circle',
126
+ 'mars-and-venus': 'venus-and-mars',
127
+ 'bone-break': 'bone-fracture',
128
+ 'running': 'footprints',
129
+ 'person-running': 'footprints',
130
+ 'walking': 'footprints',
131
+ 'person-walking': 'footprints',
132
+ 'biking': 'bike',
133
+ 'person-biking': 'bike',
134
+ 'swimmer': 'waves',
135
+ 'apple-alt': 'apple',
136
+ 'apple-whole': 'apple',
137
+ 'carrot': 'carrot',
138
+ 'seedling': 'sprout',
139
+ 'spa': 'flower',
140
+ 'dumbbell': 'dumbbell',
141
+
142
+ // --- People / accounts ---
143
+ 'user-tie': 'user-round',
144
+ 'user-shield': 'shield-user',
145
+ 'user-graduate': 'graduation-cap',
146
+ 'user-friends': 'users',
147
+ 'user-group': 'users',
148
+ 'user-circle': 'circle-user',
149
+ 'user-large': 'user-round',
150
+ 'user-edit': 'user-round-pen',
151
+ 'user-pen': 'user-round-pen',
152
+ 'user-lock': 'user-lock',
153
+ 'user-times': 'user-round-x',
154
+ 'user-xmark': 'user-round-x',
155
+ 'user-minus': 'user-round-minus',
156
+ 'user-check': 'user-round-check',
157
+ 'user-cog': 'user-round-cog',
158
+ 'user-gear': 'user-round-cog',
159
+ 'user-secret': 'venetian-mask',
160
+ 'user-astronaut': 'rocket',
161
+ 'user-ninja': 'venetian-mask',
162
+ 'users-cog': 'users',
163
+ 'users-gear': 'users',
164
+ 'address-card': 'id-card',
165
+ 'address-book': 'book-user',
166
+ 'id-badge': 'id-card',
167
+ 'id-card-alt': 'id-card',
168
+ 'building-user': 'building-2',
169
+ 'handshake': 'handshake',
170
+ 'people-group': 'users',
171
+ 'people-arrows': 'users',
172
+ 'people-carry': 'users',
173
+
174
+ // --- Places / navigation ---
175
+ 'map-marker-alt': 'map-pin',
176
+ 'map-marker': 'map-pin',
177
+ 'location-dot': 'map-pin',
178
+ 'location-pin': 'map-pin',
179
+ 'map-marked': 'map-pinned',
180
+ 'map-marked-alt': 'map-pinned',
181
+ 'map-location': 'map-pinned',
182
+ 'map-location-dot': 'map-pinned',
183
+ 'location-arrow': 'navigation',
184
+ 'location-crosshairs': 'locate-fixed',
185
+ 'crosshairs': 'crosshair',
186
+ 'directions': 'signpost',
187
+ 'diamond-turn-right': 'signpost',
188
+ 'satellite': 'satellite',
189
+ 'satellite-dish': 'satellite-dish',
190
+ 'compass': 'compass',
191
+ 'route': 'route',
192
+ 'home': 'house',
193
+ 'house-user': 'house',
194
+ 'building': 'building-2',
195
+ 'city': 'building',
196
+ 'landmark': 'landmark',
197
+ 'store': 'store',
198
+ 'store-alt': 'store',
199
+ 'shop': 'store',
200
+ 'warehouse': 'warehouse',
201
+ 'truck': 'truck',
202
+ 'shipping-fast': 'truck',
203
+ 'truck-fast': 'truck',
204
+ 'globe': 'globe',
205
+ 'globe-americas': 'globe',
206
+ 'earth-americas': 'globe',
207
+ 'earth-europe': 'globe',
208
+
209
+ // --- Time / calendar ---
210
+ 'calendar-alt': 'calendar',
211
+ 'calendar-days': 'calendar',
212
+ 'calendar-day': 'calendar',
213
+ 'calendar-week': 'calendar-range',
214
+ 'calendar-times': 'calendar-x',
215
+ 'calendar-xmark': 'calendar-x',
216
+ 'calendar-minus': 'calendar-minus',
217
+ 'calendar-plus': 'calendar-plus',
218
+ 'calendar-check': 'calendar-check',
219
+ 'clock': 'clock',
220
+ 'history': 'history',
221
+ 'hourglass-half': 'hourglass',
222
+ 'hourglass-end': 'hourglass',
223
+ 'hourglass-start': 'hourglass',
224
+ 'stopwatch': 'timer',
225
+ 'business-time': 'briefcase',
226
+
227
+ // --- Communication ---
228
+ 'phone-alt': 'phone',
229
+ 'phone-volume': 'phone-call',
230
+ 'phone-square': 'phone',
231
+ 'mobile-alt': 'smartphone',
232
+ 'mobile': 'smartphone',
233
+ 'mobile-screen': 'smartphone',
234
+ 'mobile-screen-button': 'smartphone',
235
+ 'envelope': 'mail',
236
+ 'envelope-open': 'mail-open',
237
+ 'envelope-open-text': 'mail-open',
238
+ 'at': 'at-sign',
239
+ 'comment': 'message-circle',
240
+ 'comment-alt': 'message-square',
241
+ 'comment-dots': 'message-circle-more',
242
+ 'comment-medical': 'message-circle-plus',
243
+ 'comment-sms': 'message-square-text',
244
+ 'comments': 'messages-square',
245
+ 'sms': 'message-square-text',
246
+ 'paper-plane': 'send',
247
+ 'reply': 'reply',
248
+ 'share': 'share-2',
249
+ 'share-alt': 'share-2',
250
+ 'share-nodes': 'share-2',
251
+ 'bullhorn': 'megaphone',
252
+ 'headset': 'headset',
253
+ 'headphones': 'headphones',
254
+ 'microphone': 'mic',
255
+ 'microphone-alt': 'mic',
256
+ 'video': 'video',
257
+ 'bell': 'bell',
258
+ 'rss': 'rss',
259
+ 'inbox': 'inbox',
260
+ 'whatsapp': 'message-circle',
261
+ 'whatsapp-square': 'message-circle',
262
+ 'telegram': 'send',
263
+ 'telegram-plane': 'send',
264
+ 'waze': 'navigation',
265
+ 'google-maps': 'map-pin',
266
+
267
+ // --- Status / feedback ---
268
+ 'check': 'check',
269
+ 'check-circle': 'circle-check',
270
+ 'check-double': 'check-check',
271
+ 'check-square': 'square-check',
272
+ 'circle-check': 'circle-check',
273
+ 'times': 'x',
274
+ 'xmark': 'x',
275
+ 'close': 'x',
276
+ 'times-circle': 'circle-x',
277
+ 'xmark-circle': 'circle-x',
278
+ 'circle-xmark': 'circle-x',
279
+ 'info-circle': 'info',
280
+ 'circle-info': 'info',
281
+ 'question-circle': 'circle-help',
282
+ 'circle-question': 'circle-help',
283
+ 'exclamation-circle': 'circle-alert',
284
+ 'circle-exclamation': 'circle-alert',
285
+ 'exclamation-triangle': 'triangle-alert',
286
+ 'triangle-exclamation': 'triangle-alert',
287
+ 'exclamation': 'circle-alert',
288
+ 'ban': 'ban',
289
+ 'bolt': 'zap',
290
+ 'spinner': 'loader-circle',
291
+ 'circle-notch': 'loader-circle',
292
+ 'sync': 'refresh-cw',
293
+ 'sync-alt': 'refresh-cw',
294
+ 'rotate': 'refresh-cw',
295
+ 'redo': 'redo-2',
296
+ 'redo-alt': 'redo-2',
297
+ 'undo': 'undo-2',
298
+ 'undo-alt': 'undo-2',
299
+ 'flag': 'flag',
300
+ 'certificate': 'badge-check',
301
+ 'medal': 'medal',
302
+ 'award': 'award',
303
+ 'trophy': 'trophy',
304
+ 'star-half-alt': 'star-half',
305
+ 'star-half-stroke': 'star-half',
306
+ 'thumbs-up': 'thumbs-up',
307
+ 'thumbs-down': 'thumbs-down',
308
+ 'lightbulb': 'lightbulb',
309
+ 'magic': 'wand-sparkles',
310
+ 'wand-magic-sparkles': 'wand-sparkles',
311
+ 'wand-magic': 'wand-sparkles',
312
+ 'robot': 'bot',
313
+ 'gift': 'gift',
314
+
315
+ // --- Interface ---
316
+ 'search': 'search',
317
+ 'magnifying-glass': 'search',
318
+ 'search-plus': 'zoom-in',
319
+ 'search-minus': 'zoom-out',
320
+ 'magnifying-glass-plus': 'zoom-in',
321
+ 'magnifying-glass-minus': 'zoom-out',
322
+ 'plus-circle': 'circle-plus',
323
+ 'circle-plus': 'circle-plus',
324
+ 'minus-circle': 'circle-minus',
325
+ 'circle-minus': 'circle-minus',
326
+ 'pen': 'pen',
327
+ 'pencil-alt': 'pencil',
328
+ 'pen-to-square': 'square-pen',
329
+ 'edit': 'square-pen',
330
+ 'pen-alt': 'pen-line',
331
+ 'trash-alt': 'trash-2',
332
+ 'trash-can': 'trash-2',
333
+ 'trash': 'trash-2',
334
+ 'save': 'save',
335
+ 'floppy-disk': 'save',
336
+ 'cog': 'settings',
337
+ 'cogs': 'settings',
338
+ 'gear': 'settings',
339
+ 'gears': 'settings',
340
+ 'sliders-h': 'sliders-horizontal',
341
+ 'sliders': 'sliders-horizontal',
342
+ 'filter': 'funnel',
343
+ 'sort': 'arrow-up-down',
344
+ 'sort-amount-down': 'arrow-down-wide-narrow',
345
+ 'sort-amount-up': 'arrow-up-narrow-wide',
346
+ 'arrow-down-wide-short': 'arrow-down-wide-narrow',
347
+ 'arrow-up-wide-short': 'arrow-up-narrow-wide',
348
+ 'arrow-down-up': 'arrow-up-down',
349
+ 'exchange-alt': 'arrow-left-right',
350
+ 'arrows-alt-h': 'arrow-left-right',
351
+ 'arrows-alt-v': 'arrow-up-down',
352
+ 'arrows-alt': 'move',
353
+ 'expand-arrows-alt': 'move',
354
+ 'expand-alt': 'maximize-2',
355
+ 'expand': 'maximize',
356
+ 'compress': 'minimize',
357
+ 'compress-alt': 'minimize-2',
358
+ 'external-link-alt': 'external-link',
359
+ 'external-link-square-alt': 'square-arrow-out-up-right',
360
+ 'arrow-up-right-from-square': 'external-link',
361
+ 'link': 'link',
362
+ 'unlink': 'unlink',
363
+ 'chain': 'link',
364
+ 'copy': 'copy',
365
+ 'clipboard': 'clipboard',
366
+ 'clipboard-check': 'clipboard-check',
367
+ 'clipboard-list': 'clipboard-list',
368
+ 'paste': 'clipboard-paste',
369
+ 'print': 'printer',
370
+ 'download': 'download',
371
+ 'upload': 'upload',
372
+ 'cloud-upload-alt': 'cloud-upload',
373
+ 'cloud-download-alt': 'cloud-download',
374
+ 'sign-out-alt': 'log-out',
375
+ 'right-from-bracket': 'log-out',
376
+ 'sign-in-alt': 'log-in',
377
+ 'right-to-bracket': 'log-in',
378
+ 'ellipsis-h': 'ellipsis',
379
+ 'ellipsis-v': 'ellipsis-vertical',
380
+ 'ellipsis': 'ellipsis',
381
+ 'bars': 'menu',
382
+ 'navicon': 'menu',
383
+ 'th': 'grid-3x3',
384
+ 'th-large': 'layout-grid',
385
+ 'th-list': 'list',
386
+ 'table-cells': 'table',
387
+ 'columns': 'columns-3',
388
+ 'table-columns': 'columns-3',
389
+ 'list-ul': 'list',
390
+ 'list-ol': 'list-ordered',
391
+ 'tasks': 'list-checks',
392
+ 'list-check': 'list-checks',
393
+ 'tachometer-alt': 'gauge',
394
+ 'gauge-high': 'gauge',
395
+ 'tachometer-alt-fast': 'gauge',
396
+ 'chart-bar': 'chart-column',
397
+ 'chart-column': 'chart-column',
398
+ 'chart-line': 'chart-line',
399
+ 'chart-pie': 'chart-pie',
400
+ 'chart-area': 'chart-area',
401
+ 'line-chart': 'chart-line',
402
+ 'bar-chart': 'chart-column',
403
+ 'pie-chart': 'chart-pie',
404
+ 'poll': 'chart-column',
405
+ 'eye-slash': 'eye-off',
406
+ 'lock-open': 'lock-open',
407
+ 'unlock': 'lock-open',
408
+ 'unlock-alt': 'lock-open',
409
+ 'key': 'key-round',
410
+ 'shield-alt': 'shield',
411
+ 'shield-halved': 'shield',
412
+ 'fingerprint': 'fingerprint-pattern',
413
+ 'qrcode': 'qr-code',
414
+ 'barcode': 'barcode',
415
+ 'tv': 'tv',
416
+ 'desktop': 'monitor',
417
+ 'laptop': 'laptop',
418
+ 'laptop-medical': 'laptop',
419
+ 'tablet-alt': 'tablet',
420
+ 'wifi': 'wifi',
421
+ 'camera': 'camera',
422
+ 'camera-retro': 'camera',
423
+ 'image': 'image',
424
+ 'images': 'images',
425
+ 'photo-video': 'images',
426
+ 'play': 'play',
427
+ 'play-circle': 'circle-play',
428
+ 'circle-play': 'circle-play',
429
+ 'pause': 'pause',
430
+ 'pause-circle': 'circle-pause',
431
+ 'stop': 'square',
432
+ 'stop-circle': 'circle-stop',
433
+
434
+ // --- Arrows / chevrons ---
435
+ 'angle-right': 'chevron-right',
436
+ 'angle-left': 'chevron-left',
437
+ 'angle-up': 'chevron-up',
438
+ 'angle-down': 'chevron-down',
439
+ 'angle-double-right': 'chevrons-right',
440
+ 'angle-double-left': 'chevrons-left',
441
+ 'angle-double-up': 'chevrons-up',
442
+ 'angle-double-down': 'chevrons-down',
443
+ 'angles-right': 'chevrons-right',
444
+ 'angles-left': 'chevrons-left',
445
+ 'chevron-circle-right': 'circle-chevron-right',
446
+ 'chevron-circle-left': 'circle-chevron-left',
447
+ 'chevron-circle-up': 'circle-chevron-up',
448
+ 'chevron-circle-down': 'circle-chevron-down',
449
+ 'long-arrow-alt-right': 'move-right',
450
+ 'long-arrow-alt-left': 'move-left',
451
+ 'arrow-circle-right': 'circle-arrow-right',
452
+ 'arrow-circle-left': 'circle-arrow-left',
453
+ 'arrow-circle-up': 'circle-arrow-up',
454
+ 'arrow-circle-down': 'circle-arrow-down',
455
+ 'caret-right': 'chevron-right',
456
+ 'caret-left': 'chevron-left',
457
+ 'caret-up': 'chevron-up',
458
+ 'caret-down': 'chevron-down',
459
+ 'level-up-alt': 'corner-right-up',
460
+ 'level-down-alt': 'corner-right-down',
461
+
462
+ // --- Commerce / business ---
463
+ 'shopping-bag': 'shopping-bag',
464
+ 'shopping-basket': 'shopping-basket',
465
+ 'cart-shopping': 'shopping-cart',
466
+ 'cart-plus': 'shopping-cart',
467
+ 'money-bill': 'banknote',
468
+ 'money-bill-wave': 'banknote',
469
+ 'money-bill-alt': 'banknote',
470
+ 'money-check': 'banknote',
471
+ 'money-check-alt': 'banknote',
472
+ 'dollar-sign': 'dollar-sign',
473
+ 'coins': 'coins',
474
+ 'credit-card': 'credit-card',
475
+ 'wallet': 'wallet',
476
+ 'receipt': 'receipt',
477
+ 'tag': 'tag',
478
+ 'tags': 'tags',
479
+ 'percent': 'percent',
480
+ 'percentage': 'percent',
481
+ 'box': 'package',
482
+ 'box-open': 'package-open',
483
+ 'boxes': 'package',
484
+ 'boxes-stacked': 'package',
485
+ 'cube': 'box',
486
+ 'cubes': 'boxes',
487
+ 'briefcase': 'briefcase',
488
+ 'suitcase': 'briefcase',
489
+ 'handshake-angle': 'hand-helping',
490
+ 'hand-holding-usd': 'hand-coins',
491
+ 'hand-holding-dollar': 'hand-coins',
492
+ 'balance-scale-left': 'scale',
493
+ 'gavel': 'gavel',
494
+ 'file-contract': 'file-signature',
495
+ 'signature': 'signature',
496
+ 'stamp': 'stamp',
497
+ 'sitemap': 'network',
498
+ 'project-diagram': 'workflow',
499
+ 'diagram-project': 'workflow',
500
+ 'code-branch': 'git-branch',
501
+ 'code': 'code',
502
+ 'terminal': 'terminal',
503
+ 'database': 'database',
504
+ 'server': 'server',
505
+ 'cloud': 'cloud',
506
+ 'graduation-cap': 'graduation-cap',
507
+ 'university': 'landmark',
508
+ 'school': 'school',
509
+ 'book': 'book',
510
+ 'book-medical': 'book-heart',
511
+ 'book-open': 'book-open',
512
+ 'newspaper': 'newspaper',
513
+ 'quote-left': 'quote',
514
+ 'quote-right': 'quote',
515
+ 'comment-alt-medical': 'message-circle-plus',
516
+ 'utensils': 'utensils',
517
+ 'coffee': 'coffee',
518
+ 'mug-hot': 'coffee',
519
+ 'bicycle': 'bike',
520
+ 'car': 'car',
521
+ 'bus': 'bus',
522
+ 'plane': 'plane',
523
+ 'ambulance': 'ambulance',
524
+ 'hand-paper': 'hand',
525
+ 'hand-pointer': 'pointer',
526
+ 'hand-point-right': 'hand',
527
+ 'sun': 'sun',
528
+ 'moon': 'moon',
529
+ 'fire': 'flame',
530
+ 'fire-alt': 'flame',
531
+ 'tint': 'droplet',
532
+ 'water': 'waves',
533
+ 'wind': 'wind',
534
+ 'snowflake': 'snowflake',
535
+ 'leaf': 'leaf',
536
+ 'tree': 'tree-pine',
537
+ 'paw': 'paw-print',
538
+ 'dog': 'dog',
539
+ 'cat': 'cat',
540
+ 'horse': 'paw-print',
541
+ 'bug': 'bug',
542
+ 'smile': 'smile',
543
+ 'frown': 'frown',
544
+ 'meh': 'meh',
545
+ 'grin': 'smile',
546
+ 'laugh': 'laugh',
547
+ 'dizzy': 'annoyed',
548
+ 'heartbeat-alt': 'activity',
549
+ 'wave-square': 'audio-waveform',
550
+ 'wave-pulse': 'activity',
551
+ 'chart-simple': 'chart-no-axes-column',
552
+ 'ruler': 'ruler',
553
+ 'tools': 'wrench',
554
+ 'screwdriver-wrench': 'wrench',
555
+ 'wrench': 'wrench',
556
+ 'hammer': 'hammer',
557
+ 'paint-brush': 'paintbrush',
558
+ 'palette': 'palette',
559
+ 'drafting-compass': 'drafting-compass',
560
+ 'pen-nib': 'pen-tool',
561
+ 'font': 'type',
562
+ 'bold': 'bold',
563
+ 'italic': 'italic',
564
+ 'underline': 'underline',
565
+ 'align-left': 'align-left',
566
+ 'align-center': 'align-center',
567
+ 'align-right': 'align-right',
568
+ 'language': 'languages',
569
+ 'heading': 'heading',
570
+ 'paragraph': 'pilcrow',
571
+ 'bookmark': 'bookmark',
572
+ 'folder': 'folder',
573
+ 'folder-open': 'folder-open',
574
+ 'archive': 'archive',
575
+ 'box-archive': 'archive',
576
+ 'file': 'file',
577
+ 'file-pdf': 'file-text',
578
+ 'file-word': 'file-text',
579
+ 'file-excel': 'file-spreadsheet',
580
+ 'file-image': 'file-image',
581
+ 'file-upload': 'file-up',
582
+ 'file-download': 'file-down',
583
+ 'file-export': 'file-output',
584
+ 'file-import': 'file-input',
585
+ 'file-signature': 'file-signature',
586
+ 'file-csv': 'file-spreadsheet',
587
+ 'circle': 'circle',
588
+ 'square': 'square',
589
+ 'dot-circle': 'circle-dot',
590
+ 'circle-dot': 'circle-dot',
591
+ 'plus': 'plus',
592
+ 'minus': 'minus',
593
+ 'star': 'star',
594
+ 'heart': 'heart',
595
+ 'eye': 'eye',
596
+ 'bone': 'bone',
597
+ 'brain': 'brain',
598
+ 'baby': 'baby',
599
+ 'stethoscope': 'stethoscope',
600
+ 'hospital': 'hospital',
601
+ 'cross': 'cross',
602
+ }
@@ -0,0 +1,59 @@
1
+ // Host-pluggable icon resolvers. A host that stores icons in a format the SDK
2
+ // does not parse (real FontAwesome, Iconify, its own sprite sheet...) registers
3
+ // a function once at boot and every <Icon>/<DynamicIcon>/`type: 'icon'` column
4
+ // understands it, without touching the SDK.
5
+ //
6
+ // Resolution order (documented contract):
7
+ // 1. host resolvers, MOST RECENTLY REGISTERED FIRST; the first one that
8
+ // returns something other than null/undefined wins;
9
+ // 2. the built-in parser (`parseIconSpec`): Lucide, FontAwesome aliases,
10
+ // emoji, images.
11
+ // A resolver receives the raw string and returns an `IconSpec` (delegate to
12
+ // the built-in renderers), a `ReactNode` (render exactly that), or `null` to
13
+ // pass. A resolver that throws is skipped.
14
+ import type { ReactNode } from 'react'
15
+ import { parseIconSpec, type IconSpec } from './icon-spec'
16
+
17
+ export type IconResolver = (spec: string) => IconSpec | ReactNode | null | undefined
18
+
19
+ /** Outcome of resolving: a built-in spec, or a node the host rendered itself. */
20
+ export type ResolvedIcon = IconSpec | { kind: 'node'; node: ReactNode }
21
+
22
+ const resolvers: IconResolver[] = []
23
+
24
+ const SPEC_KINDS = new Set(['lucide', 'emoji', 'image', 'unknown'])
25
+
26
+ function isIconSpec(v: unknown): v is IconSpec {
27
+ return (
28
+ typeof v === 'object' &&
29
+ v !== null &&
30
+ !('$$typeof' in v) &&
31
+ SPEC_KINDS.has((v as { kind?: unknown }).kind as string)
32
+ )
33
+ }
34
+
35
+ /** Registers a resolver; returns the disposer that removes it. */
36
+ export function registerIconResolver(fn: IconResolver): () => void {
37
+ resolvers.push(fn)
38
+ return () => {
39
+ const i = resolvers.lastIndexOf(fn)
40
+ if (i >= 0) resolvers.splice(i, 1)
41
+ }
42
+ }
43
+
44
+ /** Host resolvers first (newest first), then the built-in parser. */
45
+ export function resolveIconSpec(spec: unknown): ResolvedIcon {
46
+ if (typeof spec === 'string' && spec.trim() !== '') {
47
+ for (let i = resolvers.length - 1; i >= 0; i--) {
48
+ let out: ReturnType<IconResolver>
49
+ try {
50
+ out = resolvers[i]!(spec)
51
+ } catch {
52
+ continue
53
+ }
54
+ if (out === null || out === undefined) continue
55
+ return isIconSpec(out) ? out : { kind: 'node', node: out }
56
+ }
57
+ }
58
+ return parseIconSpec(spec)
59
+ }