@promptui-lib/codegen 0.1.2 → 0.1.4

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.
@@ -0,0 +1,1093 @@
1
+ /**
2
+ * Component Mappings
3
+ * Maps Figma frame names to framework-specific components
4
+ */
5
+ /**
6
+ * Component mappings by name
7
+ * Key is the component name (without #), case-insensitive matching
8
+ */
9
+ export const COMPONENT_MAPPINGS = {
10
+ // ============= BUTTONS =============
11
+ button: {
12
+ bootstrap: {
13
+ tag: 'button',
14
+ classes: ['btn', 'btn-primary'],
15
+ },
16
+ mui: {
17
+ component: 'Button',
18
+ props: { variant: 'contained' },
19
+ imports: ["import { Button } from '@mui/material';"],
20
+ },
21
+ tailwind: {
22
+ tag: 'button',
23
+ classes: ['px-4', 'py-2', 'rounded-lg', 'font-medium'],
24
+ },
25
+ scss: {
26
+ tag: 'button',
27
+ baseClass: 'button',
28
+ },
29
+ flutter: {
30
+ widget: 'ElevatedButton',
31
+ props: { onPressed: '() {}' },
32
+ },
33
+ swiftui: {
34
+ view: 'Button',
35
+ modifiers: ['.buttonStyle(.borderedProminent)'],
36
+ },
37
+ },
38
+ buttongroup: {
39
+ bootstrap: {
40
+ tag: 'div',
41
+ classes: ['btn-group'],
42
+ wrapper: 'role="group"',
43
+ },
44
+ mui: {
45
+ component: 'ButtonGroup',
46
+ imports: ["import { ButtonGroup } from '@mui/material';"],
47
+ },
48
+ tailwind: {
49
+ tag: 'div',
50
+ classes: ['inline-flex', 'rounded-lg', 'overflow-hidden'],
51
+ },
52
+ scss: {
53
+ tag: 'div',
54
+ baseClass: 'button-group',
55
+ },
56
+ flutter: {
57
+ widget: 'Row',
58
+ },
59
+ swiftui: {
60
+ view: 'HStack',
61
+ modifiers: ['.spacing(0)'],
62
+ },
63
+ },
64
+ // ============= ALERTS =============
65
+ alert: {
66
+ bootstrap: {
67
+ tag: 'div',
68
+ classes: ['alert', 'alert-primary'],
69
+ wrapper: 'role="alert"',
70
+ },
71
+ mui: {
72
+ component: 'Alert',
73
+ props: { severity: 'info' },
74
+ imports: ["import { Alert } from '@mui/material';"],
75
+ },
76
+ tailwind: {
77
+ tag: 'div',
78
+ classes: ['p-4', 'rounded-lg', 'border'],
79
+ },
80
+ scss: {
81
+ tag: 'div',
82
+ baseClass: 'alert',
83
+ },
84
+ flutter: {
85
+ widget: 'Container',
86
+ props: {
87
+ padding: 'EdgeInsets.all(16)',
88
+ decoration: 'BoxDecoration(borderRadius: BorderRadius.circular(8))',
89
+ },
90
+ },
91
+ swiftui: {
92
+ view: 'HStack',
93
+ modifiers: ['.padding()', '.background(Color.blue.opacity(0.1))', '.cornerRadius(8)'],
94
+ },
95
+ },
96
+ // ============= BADGES =============
97
+ badge: {
98
+ bootstrap: {
99
+ tag: 'span',
100
+ classes: ['badge', 'bg-primary'],
101
+ },
102
+ mui: {
103
+ component: 'Chip',
104
+ props: { size: 'small' },
105
+ imports: ["import { Chip } from '@mui/material';"],
106
+ },
107
+ tailwind: {
108
+ tag: 'span',
109
+ classes: ['px-2', 'py-1', 'text-xs', 'font-medium', 'rounded-full'],
110
+ },
111
+ scss: {
112
+ tag: 'span',
113
+ baseClass: 'badge',
114
+ },
115
+ flutter: {
116
+ widget: 'Container',
117
+ props: {
118
+ padding: 'EdgeInsets.symmetric(horizontal: 8, vertical: 4)',
119
+ decoration: 'BoxDecoration(borderRadius: BorderRadius.circular(12))',
120
+ },
121
+ },
122
+ swiftui: {
123
+ view: 'Text',
124
+ modifiers: ['.font(.caption)', '.padding(.horizontal, 8)', '.padding(.vertical, 4)', '.background(Capsule())'],
125
+ },
126
+ },
127
+ // ============= CARDS =============
128
+ card: {
129
+ bootstrap: {
130
+ tag: 'div',
131
+ classes: ['card'],
132
+ },
133
+ mui: {
134
+ component: 'Card',
135
+ imports: ["import { Card, CardContent } from '@mui/material';"],
136
+ },
137
+ tailwind: {
138
+ tag: 'div',
139
+ classes: ['rounded-lg', 'shadow-md', 'overflow-hidden', 'bg-white'],
140
+ },
141
+ scss: {
142
+ tag: 'div',
143
+ baseClass: 'card',
144
+ },
145
+ flutter: {
146
+ widget: 'Card',
147
+ props: { elevation: '2' },
148
+ },
149
+ swiftui: {
150
+ view: 'VStack',
151
+ modifiers: ['.background(Color.white)', '.cornerRadius(12)', '.shadow(radius: 4)'],
152
+ },
153
+ },
154
+ // ============= MODALS / DIALOGS =============
155
+ modal: {
156
+ bootstrap: {
157
+ tag: 'div',
158
+ classes: ['modal'],
159
+ children: '<div class="modal-dialog"><div class="modal-content"></div></div>',
160
+ },
161
+ mui: {
162
+ component: 'Dialog',
163
+ imports: ["import { Dialog, DialogTitle, DialogContent, DialogActions } from '@mui/material';"],
164
+ },
165
+ tailwind: {
166
+ tag: 'div',
167
+ classes: ['fixed', 'inset-0', 'z-50', 'flex', 'items-center', 'justify-center'],
168
+ },
169
+ scss: {
170
+ tag: 'div',
171
+ baseClass: 'modal',
172
+ },
173
+ flutter: {
174
+ widget: 'Dialog',
175
+ },
176
+ swiftui: {
177
+ view: 'VStack',
178
+ modifiers: ['.sheet(isPresented: $isPresented)'],
179
+ },
180
+ },
181
+ dialog: {
182
+ bootstrap: {
183
+ tag: 'div',
184
+ classes: ['modal'],
185
+ },
186
+ mui: {
187
+ component: 'Dialog',
188
+ imports: ["import { Dialog, DialogTitle, DialogContent, DialogActions } from '@mui/material';"],
189
+ },
190
+ tailwind: {
191
+ tag: 'div',
192
+ classes: ['fixed', 'inset-0', 'z-50', 'flex', 'items-center', 'justify-center'],
193
+ },
194
+ scss: {
195
+ tag: 'div',
196
+ baseClass: 'dialog',
197
+ },
198
+ flutter: {
199
+ widget: 'AlertDialog',
200
+ },
201
+ swiftui: {
202
+ view: 'VStack',
203
+ modifiers: ['.alert(isPresented: $isPresented)'],
204
+ },
205
+ },
206
+ // ============= NAVIGATION =============
207
+ navbar: {
208
+ bootstrap: {
209
+ tag: 'nav',
210
+ classes: ['navbar', 'navbar-expand-lg', 'navbar-light', 'bg-light'],
211
+ },
212
+ mui: {
213
+ component: 'AppBar',
214
+ imports: ["import { AppBar, Toolbar } from '@mui/material';"],
215
+ },
216
+ tailwind: {
217
+ tag: 'nav',
218
+ classes: ['flex', 'items-center', 'justify-between', 'px-6', 'py-4'],
219
+ },
220
+ scss: {
221
+ tag: 'nav',
222
+ baseClass: 'navbar',
223
+ },
224
+ flutter: {
225
+ widget: 'AppBar',
226
+ },
227
+ swiftui: {
228
+ view: 'NavigationStack',
229
+ },
230
+ },
231
+ nav: {
232
+ bootstrap: {
233
+ tag: 'ul',
234
+ classes: ['nav'],
235
+ },
236
+ mui: {
237
+ component: 'Tabs',
238
+ imports: ["import { Tabs, Tab } from '@mui/material';"],
239
+ },
240
+ tailwind: {
241
+ tag: 'nav',
242
+ classes: ['flex', 'space-x-4'],
243
+ },
244
+ scss: {
245
+ tag: 'nav',
246
+ baseClass: 'nav',
247
+ },
248
+ flutter: {
249
+ widget: 'Row',
250
+ },
251
+ swiftui: {
252
+ view: 'HStack',
253
+ },
254
+ },
255
+ tabs: {
256
+ bootstrap: {
257
+ tag: 'ul',
258
+ classes: ['nav', 'nav-tabs'],
259
+ },
260
+ mui: {
261
+ component: 'Tabs',
262
+ imports: ["import { Tabs, Tab } from '@mui/material';"],
263
+ },
264
+ tailwind: {
265
+ tag: 'div',
266
+ classes: ['flex', 'border-b'],
267
+ },
268
+ scss: {
269
+ tag: 'div',
270
+ baseClass: 'tabs',
271
+ },
272
+ flutter: {
273
+ widget: 'TabBar',
274
+ },
275
+ swiftui: {
276
+ view: 'TabView',
277
+ },
278
+ },
279
+ breadcrumb: {
280
+ bootstrap: {
281
+ tag: 'nav',
282
+ classes: ['breadcrumb'],
283
+ wrapper: 'aria-label="breadcrumb"',
284
+ },
285
+ mui: {
286
+ component: 'Breadcrumbs',
287
+ imports: ["import { Breadcrumbs, Link } from '@mui/material';"],
288
+ },
289
+ tailwind: {
290
+ tag: 'nav',
291
+ classes: ['flex', 'items-center', 'space-x-2', 'text-sm'],
292
+ },
293
+ scss: {
294
+ tag: 'nav',
295
+ baseClass: 'breadcrumb',
296
+ },
297
+ flutter: {
298
+ widget: 'Row',
299
+ },
300
+ swiftui: {
301
+ view: 'HStack',
302
+ },
303
+ },
304
+ pagination: {
305
+ bootstrap: {
306
+ tag: 'nav',
307
+ classes: ['pagination'],
308
+ },
309
+ mui: {
310
+ component: 'Pagination',
311
+ imports: ["import { Pagination } from '@mui/material';"],
312
+ },
313
+ tailwind: {
314
+ tag: 'nav',
315
+ classes: ['flex', 'items-center', 'space-x-1'],
316
+ },
317
+ scss: {
318
+ tag: 'nav',
319
+ baseClass: 'pagination',
320
+ },
321
+ flutter: {
322
+ widget: 'Row',
323
+ },
324
+ swiftui: {
325
+ view: 'HStack',
326
+ },
327
+ },
328
+ // ============= FORMS =============
329
+ input: {
330
+ bootstrap: {
331
+ tag: 'input',
332
+ classes: ['form-control'],
333
+ },
334
+ mui: {
335
+ component: 'TextField',
336
+ props: { variant: 'outlined', fullWidth: 'true' },
337
+ imports: ["import { TextField } from '@mui/material';"],
338
+ },
339
+ tailwind: {
340
+ tag: 'input',
341
+ classes: ['w-full', 'px-3', 'py-2', 'border', 'rounded-lg', 'focus:ring-2', 'focus:outline-none'],
342
+ },
343
+ scss: {
344
+ tag: 'input',
345
+ baseClass: 'input',
346
+ },
347
+ flutter: {
348
+ widget: 'TextField',
349
+ props: { decoration: "InputDecoration(border: OutlineInputBorder())" },
350
+ },
351
+ swiftui: {
352
+ view: 'TextField',
353
+ modifiers: ['.textFieldStyle(.roundedBorder)'],
354
+ },
355
+ },
356
+ textfield: {
357
+ bootstrap: {
358
+ tag: 'input',
359
+ classes: ['form-control'],
360
+ },
361
+ mui: {
362
+ component: 'TextField',
363
+ props: { variant: 'outlined' },
364
+ imports: ["import { TextField } from '@mui/material';"],
365
+ },
366
+ tailwind: {
367
+ tag: 'input',
368
+ classes: ['w-full', 'px-3', 'py-2', 'border', 'rounded-lg'],
369
+ },
370
+ scss: {
371
+ tag: 'input',
372
+ baseClass: 'text-field',
373
+ },
374
+ flutter: {
375
+ widget: 'TextField',
376
+ },
377
+ swiftui: {
378
+ view: 'TextField',
379
+ },
380
+ },
381
+ textarea: {
382
+ bootstrap: {
383
+ tag: 'textarea',
384
+ classes: ['form-control'],
385
+ },
386
+ mui: {
387
+ component: 'TextField',
388
+ props: { multiline: 'true', rows: '4' },
389
+ imports: ["import { TextField } from '@mui/material';"],
390
+ },
391
+ tailwind: {
392
+ tag: 'textarea',
393
+ classes: ['w-full', 'px-3', 'py-2', 'border', 'rounded-lg', 'resize-y'],
394
+ },
395
+ scss: {
396
+ tag: 'textarea',
397
+ baseClass: 'textarea',
398
+ },
399
+ flutter: {
400
+ widget: 'TextField',
401
+ props: { maxLines: 'null', minLines: '4' },
402
+ },
403
+ swiftui: {
404
+ view: 'TextEditor',
405
+ },
406
+ },
407
+ select: {
408
+ bootstrap: {
409
+ tag: 'select',
410
+ classes: ['form-select'],
411
+ },
412
+ mui: {
413
+ component: 'Select',
414
+ imports: ["import { Select, MenuItem, FormControl, InputLabel } from '@mui/material';"],
415
+ },
416
+ tailwind: {
417
+ tag: 'select',
418
+ classes: ['w-full', 'px-3', 'py-2', 'border', 'rounded-lg', 'bg-white'],
419
+ },
420
+ scss: {
421
+ tag: 'select',
422
+ baseClass: 'select',
423
+ },
424
+ flutter: {
425
+ widget: 'DropdownButton',
426
+ },
427
+ swiftui: {
428
+ view: 'Picker',
429
+ modifiers: ['.pickerStyle(.menu)'],
430
+ },
431
+ },
432
+ checkbox: {
433
+ bootstrap: {
434
+ tag: 'input',
435
+ classes: ['form-check-input'],
436
+ wrapper: 'type="checkbox"',
437
+ },
438
+ mui: {
439
+ component: 'Checkbox',
440
+ imports: ["import { Checkbox, FormControlLabel } from '@mui/material';"],
441
+ },
442
+ tailwind: {
443
+ tag: 'input',
444
+ classes: ['w-4', 'h-4', 'rounded', 'border-gray-300'],
445
+ },
446
+ scss: {
447
+ tag: 'input',
448
+ baseClass: 'checkbox',
449
+ },
450
+ flutter: {
451
+ widget: 'Checkbox',
452
+ },
453
+ swiftui: {
454
+ view: 'Toggle',
455
+ modifiers: ['.toggleStyle(.checkbox)'],
456
+ },
457
+ },
458
+ radio: {
459
+ bootstrap: {
460
+ tag: 'input',
461
+ classes: ['form-check-input'],
462
+ wrapper: 'type="radio"',
463
+ },
464
+ mui: {
465
+ component: 'Radio',
466
+ imports: ["import { Radio, RadioGroup, FormControlLabel } from '@mui/material';"],
467
+ },
468
+ tailwind: {
469
+ tag: 'input',
470
+ classes: ['w-4', 'h-4', 'border-gray-300'],
471
+ },
472
+ scss: {
473
+ tag: 'input',
474
+ baseClass: 'radio',
475
+ },
476
+ flutter: {
477
+ widget: 'Radio',
478
+ },
479
+ swiftui: {
480
+ view: 'Picker',
481
+ modifiers: ['.pickerStyle(.radioGroup)'],
482
+ },
483
+ },
484
+ switch: {
485
+ bootstrap: {
486
+ tag: 'div',
487
+ classes: ['form-check', 'form-switch'],
488
+ },
489
+ mui: {
490
+ component: 'Switch',
491
+ imports: ["import { Switch, FormControlLabel } from '@mui/material';"],
492
+ },
493
+ tailwind: {
494
+ tag: 'button',
495
+ classes: ['relative', 'inline-flex', 'h-6', 'w-11', 'rounded-full', 'transition-colors'],
496
+ },
497
+ scss: {
498
+ tag: 'label',
499
+ baseClass: 'switch',
500
+ },
501
+ flutter: {
502
+ widget: 'Switch',
503
+ },
504
+ swiftui: {
505
+ view: 'Toggle',
506
+ },
507
+ },
508
+ formgroup: {
509
+ bootstrap: {
510
+ tag: 'div',
511
+ classes: ['mb-3'],
512
+ },
513
+ mui: {
514
+ component: 'FormControl',
515
+ imports: ["import { FormControl, FormLabel } from '@mui/material';"],
516
+ },
517
+ tailwind: {
518
+ tag: 'div',
519
+ classes: ['mb-4'],
520
+ },
521
+ scss: {
522
+ tag: 'div',
523
+ baseClass: 'form-group',
524
+ },
525
+ flutter: {
526
+ widget: 'Column',
527
+ props: { crossAxisAlignment: 'CrossAxisAlignment.start' },
528
+ },
529
+ swiftui: {
530
+ view: 'VStack',
531
+ modifiers: ['.alignment(.leading)'],
532
+ },
533
+ },
534
+ // ============= FEEDBACK =============
535
+ spinner: {
536
+ bootstrap: {
537
+ tag: 'div',
538
+ classes: ['spinner-border'],
539
+ wrapper: 'role="status"',
540
+ },
541
+ mui: {
542
+ component: 'CircularProgress',
543
+ imports: ["import { CircularProgress } from '@mui/material';"],
544
+ },
545
+ tailwind: {
546
+ tag: 'div',
547
+ classes: ['animate-spin', 'rounded-full', 'border-2', 'border-t-transparent'],
548
+ },
549
+ scss: {
550
+ tag: 'div',
551
+ baseClass: 'spinner',
552
+ hasAnimation: true,
553
+ animationName: 'spin',
554
+ },
555
+ flutter: {
556
+ widget: 'CircularProgressIndicator',
557
+ },
558
+ swiftui: {
559
+ view: 'ProgressView',
560
+ modifiers: ['.progressViewStyle(.circular)'],
561
+ },
562
+ },
563
+ loading: {
564
+ bootstrap: {
565
+ tag: 'div',
566
+ classes: ['spinner-border'],
567
+ wrapper: 'role="status"',
568
+ },
569
+ mui: {
570
+ component: 'CircularProgress',
571
+ imports: ["import { CircularProgress } from '@mui/material';"],
572
+ },
573
+ tailwind: {
574
+ tag: 'div',
575
+ classes: ['animate-spin', 'rounded-full', 'border-2', 'border-t-transparent'],
576
+ },
577
+ scss: {
578
+ tag: 'div',
579
+ baseClass: 'loading',
580
+ hasAnimation: true,
581
+ animationName: 'spin',
582
+ },
583
+ flutter: {
584
+ widget: 'CircularProgressIndicator',
585
+ },
586
+ swiftui: {
587
+ view: 'ProgressView',
588
+ },
589
+ },
590
+ progress: {
591
+ bootstrap: {
592
+ tag: 'div',
593
+ classes: ['progress'],
594
+ children: '<div class="progress-bar" role="progressbar"></div>',
595
+ },
596
+ mui: {
597
+ component: 'LinearProgress',
598
+ imports: ["import { LinearProgress } from '@mui/material';"],
599
+ },
600
+ tailwind: {
601
+ tag: 'div',
602
+ classes: ['w-full', 'bg-gray-200', 'rounded-full', 'h-2'],
603
+ },
604
+ scss: {
605
+ tag: 'div',
606
+ baseClass: 'progress',
607
+ },
608
+ flutter: {
609
+ widget: 'LinearProgressIndicator',
610
+ },
611
+ swiftui: {
612
+ view: 'ProgressView',
613
+ modifiers: ['.progressViewStyle(.linear)'],
614
+ },
615
+ },
616
+ toast: {
617
+ bootstrap: {
618
+ tag: 'div',
619
+ classes: ['toast'],
620
+ wrapper: 'role="alert"',
621
+ },
622
+ mui: {
623
+ component: 'Snackbar',
624
+ imports: ["import { Snackbar, Alert } from '@mui/material';"],
625
+ },
626
+ tailwind: {
627
+ tag: 'div',
628
+ classes: ['fixed', 'bottom-4', 'right-4', 'p-4', 'rounded-lg', 'shadow-lg'],
629
+ },
630
+ scss: {
631
+ tag: 'div',
632
+ baseClass: 'toast',
633
+ },
634
+ flutter: {
635
+ widget: 'SnackBar',
636
+ },
637
+ swiftui: {
638
+ view: 'VStack',
639
+ modifiers: ['.toast(isPresented: $isPresented)'],
640
+ },
641
+ },
642
+ snackbar: {
643
+ bootstrap: {
644
+ tag: 'div',
645
+ classes: ['toast'],
646
+ },
647
+ mui: {
648
+ component: 'Snackbar',
649
+ imports: ["import { Snackbar } from '@mui/material';"],
650
+ },
651
+ tailwind: {
652
+ tag: 'div',
653
+ classes: ['fixed', 'bottom-4', 'left-1/2', '-translate-x-1/2', 'p-4', 'rounded-lg'],
654
+ },
655
+ scss: {
656
+ tag: 'div',
657
+ baseClass: 'snackbar',
658
+ },
659
+ flutter: {
660
+ widget: 'SnackBar',
661
+ },
662
+ swiftui: {
663
+ view: 'VStack',
664
+ },
665
+ },
666
+ tooltip: {
667
+ bootstrap: {
668
+ tag: 'span',
669
+ classes: [],
670
+ wrapper: 'data-bs-toggle="tooltip"',
671
+ },
672
+ mui: {
673
+ component: 'Tooltip',
674
+ imports: ["import { Tooltip } from '@mui/material';"],
675
+ },
676
+ tailwind: {
677
+ tag: 'div',
678
+ classes: ['relative', 'group'],
679
+ },
680
+ scss: {
681
+ tag: 'span',
682
+ baseClass: 'tooltip',
683
+ },
684
+ flutter: {
685
+ widget: 'Tooltip',
686
+ },
687
+ swiftui: {
688
+ view: 'Text',
689
+ modifiers: ['.help("Tooltip text")'],
690
+ },
691
+ },
692
+ // ============= LAYOUT =============
693
+ dropdown: {
694
+ bootstrap: {
695
+ tag: 'div',
696
+ classes: ['dropdown'],
697
+ },
698
+ mui: {
699
+ component: 'Menu',
700
+ imports: ["import { Menu, MenuItem, Button } from '@mui/material';"],
701
+ },
702
+ tailwind: {
703
+ tag: 'div',
704
+ classes: ['relative', 'inline-block'],
705
+ },
706
+ scss: {
707
+ tag: 'div',
708
+ baseClass: 'dropdown',
709
+ },
710
+ flutter: {
711
+ widget: 'PopupMenuButton',
712
+ },
713
+ swiftui: {
714
+ view: 'Menu',
715
+ },
716
+ },
717
+ menu: {
718
+ bootstrap: {
719
+ tag: 'ul',
720
+ classes: ['dropdown-menu'],
721
+ },
722
+ mui: {
723
+ component: 'Menu',
724
+ imports: ["import { Menu, MenuItem } from '@mui/material';"],
725
+ },
726
+ tailwind: {
727
+ tag: 'div',
728
+ classes: ['absolute', 'mt-2', 'py-2', 'bg-white', 'rounded-lg', 'shadow-lg'],
729
+ },
730
+ scss: {
731
+ tag: 'ul',
732
+ baseClass: 'menu',
733
+ },
734
+ flutter: {
735
+ widget: 'PopupMenuButton',
736
+ },
737
+ swiftui: {
738
+ view: 'Menu',
739
+ },
740
+ },
741
+ listgroup: {
742
+ bootstrap: {
743
+ tag: 'ul',
744
+ classes: ['list-group'],
745
+ },
746
+ mui: {
747
+ component: 'List',
748
+ imports: ["import { List, ListItem, ListItemText } from '@mui/material';"],
749
+ },
750
+ tailwind: {
751
+ tag: 'ul',
752
+ classes: ['divide-y', 'rounded-lg', 'border'],
753
+ },
754
+ scss: {
755
+ tag: 'ul',
756
+ baseClass: 'list-group',
757
+ },
758
+ flutter: {
759
+ widget: 'ListView',
760
+ },
761
+ swiftui: {
762
+ view: 'List',
763
+ },
764
+ },
765
+ list: {
766
+ bootstrap: {
767
+ tag: 'ul',
768
+ classes: ['list-group'],
769
+ },
770
+ mui: {
771
+ component: 'List',
772
+ imports: ["import { List, ListItem } from '@mui/material';"],
773
+ },
774
+ tailwind: {
775
+ tag: 'ul',
776
+ classes: ['space-y-2'],
777
+ },
778
+ scss: {
779
+ tag: 'ul',
780
+ baseClass: 'list',
781
+ },
782
+ flutter: {
783
+ widget: 'ListView',
784
+ },
785
+ swiftui: {
786
+ view: 'List',
787
+ },
788
+ },
789
+ table: {
790
+ bootstrap: {
791
+ tag: 'table',
792
+ classes: ['table'],
793
+ },
794
+ mui: {
795
+ component: 'Table',
796
+ imports: ["import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material';"],
797
+ },
798
+ tailwind: {
799
+ tag: 'table',
800
+ classes: ['w-full', 'text-left', 'border-collapse'],
801
+ },
802
+ scss: {
803
+ tag: 'table',
804
+ baseClass: 'table',
805
+ },
806
+ flutter: {
807
+ widget: 'DataTable',
808
+ },
809
+ swiftui: {
810
+ view: 'Table',
811
+ },
812
+ },
813
+ accordion: {
814
+ bootstrap: {
815
+ tag: 'div',
816
+ classes: ['accordion'],
817
+ },
818
+ mui: {
819
+ component: 'Accordion',
820
+ imports: ["import { Accordion, AccordionSummary, AccordionDetails } from '@mui/material';"],
821
+ },
822
+ tailwind: {
823
+ tag: 'div',
824
+ classes: ['divide-y', 'border', 'rounded-lg'],
825
+ },
826
+ scss: {
827
+ tag: 'div',
828
+ baseClass: 'accordion',
829
+ },
830
+ flutter: {
831
+ widget: 'ExpansionPanelList',
832
+ },
833
+ swiftui: {
834
+ view: 'DisclosureGroup',
835
+ },
836
+ },
837
+ collapse: {
838
+ bootstrap: {
839
+ tag: 'div',
840
+ classes: ['collapse'],
841
+ },
842
+ mui: {
843
+ component: 'Collapse',
844
+ imports: ["import { Collapse } from '@mui/material';"],
845
+ },
846
+ tailwind: {
847
+ tag: 'div',
848
+ classes: ['overflow-hidden', 'transition-all'],
849
+ },
850
+ scss: {
851
+ tag: 'div',
852
+ baseClass: 'collapse',
853
+ },
854
+ flutter: {
855
+ widget: 'AnimatedContainer',
856
+ },
857
+ swiftui: {
858
+ view: 'VStack',
859
+ modifiers: ['.animation(.easeInOut)'],
860
+ },
861
+ },
862
+ carousel: {
863
+ bootstrap: {
864
+ tag: 'div',
865
+ classes: ['carousel', 'slide'],
866
+ wrapper: 'data-bs-ride="carousel"',
867
+ },
868
+ mui: {
869
+ component: 'Box',
870
+ imports: ["import { Box, IconButton } from '@mui/material';"],
871
+ },
872
+ tailwind: {
873
+ tag: 'div',
874
+ classes: ['relative', 'overflow-hidden'],
875
+ },
876
+ scss: {
877
+ tag: 'div',
878
+ baseClass: 'carousel',
879
+ },
880
+ flutter: {
881
+ widget: 'PageView',
882
+ },
883
+ swiftui: {
884
+ view: 'TabView',
885
+ modifiers: ['.tabViewStyle(.page)'],
886
+ },
887
+ },
888
+ offcanvas: {
889
+ bootstrap: {
890
+ tag: 'div',
891
+ classes: ['offcanvas', 'offcanvas-start'],
892
+ },
893
+ mui: {
894
+ component: 'Drawer',
895
+ imports: ["import { Drawer } from '@mui/material';"],
896
+ },
897
+ tailwind: {
898
+ tag: 'div',
899
+ classes: ['fixed', 'inset-y-0', 'left-0', 'w-64', 'transform', '-translate-x-full'],
900
+ },
901
+ scss: {
902
+ tag: 'div',
903
+ baseClass: 'offcanvas',
904
+ },
905
+ flutter: {
906
+ widget: 'Drawer',
907
+ },
908
+ swiftui: {
909
+ view: 'VStack',
910
+ modifiers: ['.sheet(isPresented: $isPresented)'],
911
+ },
912
+ },
913
+ drawer: {
914
+ bootstrap: {
915
+ tag: 'div',
916
+ classes: ['offcanvas', 'offcanvas-start'],
917
+ },
918
+ mui: {
919
+ component: 'Drawer',
920
+ imports: ["import { Drawer } from '@mui/material';"],
921
+ },
922
+ tailwind: {
923
+ tag: 'div',
924
+ classes: ['fixed', 'inset-y-0', 'left-0', 'w-64', 'bg-white', 'shadow-lg'],
925
+ },
926
+ scss: {
927
+ tag: 'aside',
928
+ baseClass: 'drawer',
929
+ },
930
+ flutter: {
931
+ widget: 'Drawer',
932
+ },
933
+ swiftui: {
934
+ view: 'NavigationSplitView',
935
+ },
936
+ },
937
+ // ============= MISC =============
938
+ avatar: {
939
+ bootstrap: {
940
+ tag: 'img',
941
+ classes: ['rounded-circle'],
942
+ },
943
+ mui: {
944
+ component: 'Avatar',
945
+ imports: ["import { Avatar } from '@mui/material';"],
946
+ },
947
+ tailwind: {
948
+ tag: 'img',
949
+ classes: ['w-10', 'h-10', 'rounded-full', 'object-cover'],
950
+ },
951
+ scss: {
952
+ tag: 'div',
953
+ baseClass: 'avatar',
954
+ },
955
+ flutter: {
956
+ widget: 'CircleAvatar',
957
+ },
958
+ swiftui: {
959
+ view: 'Image',
960
+ modifiers: ['.clipShape(Circle())'],
961
+ },
962
+ },
963
+ chip: {
964
+ bootstrap: {
965
+ tag: 'span',
966
+ classes: ['badge', 'rounded-pill'],
967
+ },
968
+ mui: {
969
+ component: 'Chip',
970
+ imports: ["import { Chip } from '@mui/material';"],
971
+ },
972
+ tailwind: {
973
+ tag: 'span',
974
+ classes: ['inline-flex', 'items-center', 'px-3', 'py-1', 'rounded-full', 'text-sm'],
975
+ },
976
+ scss: {
977
+ tag: 'span',
978
+ baseClass: 'chip',
979
+ },
980
+ flutter: {
981
+ widget: 'Chip',
982
+ },
983
+ swiftui: {
984
+ view: 'Text',
985
+ modifiers: ['.padding(.horizontal, 12)', '.padding(.vertical, 6)', '.background(Capsule())'],
986
+ },
987
+ },
988
+ slider: {
989
+ bootstrap: {
990
+ tag: 'input',
991
+ classes: ['form-range'],
992
+ wrapper: 'type="range"',
993
+ },
994
+ mui: {
995
+ component: 'Slider',
996
+ imports: ["import { Slider } from '@mui/material';"],
997
+ },
998
+ tailwind: {
999
+ tag: 'input',
1000
+ classes: ['w-full', 'h-2', 'rounded-lg', 'appearance-none', 'cursor-pointer'],
1001
+ },
1002
+ scss: {
1003
+ tag: 'input',
1004
+ baseClass: 'slider',
1005
+ },
1006
+ flutter: {
1007
+ widget: 'Slider',
1008
+ },
1009
+ swiftui: {
1010
+ view: 'Slider',
1011
+ },
1012
+ },
1013
+ divider: {
1014
+ bootstrap: {
1015
+ tag: 'hr',
1016
+ classes: [],
1017
+ },
1018
+ mui: {
1019
+ component: 'Divider',
1020
+ imports: ["import { Divider } from '@mui/material';"],
1021
+ },
1022
+ tailwind: {
1023
+ tag: 'hr',
1024
+ classes: ['border-gray-200'],
1025
+ },
1026
+ scss: {
1027
+ tag: 'hr',
1028
+ baseClass: 'divider',
1029
+ },
1030
+ flutter: {
1031
+ widget: 'Divider',
1032
+ },
1033
+ swiftui: {
1034
+ view: 'Divider',
1035
+ },
1036
+ },
1037
+ skeleton: {
1038
+ bootstrap: {
1039
+ tag: 'div',
1040
+ classes: ['placeholder-glow'],
1041
+ },
1042
+ mui: {
1043
+ component: 'Skeleton',
1044
+ imports: ["import { Skeleton } from '@mui/material';"],
1045
+ },
1046
+ tailwind: {
1047
+ tag: 'div',
1048
+ classes: ['animate-pulse', 'bg-gray-200', 'rounded'],
1049
+ },
1050
+ scss: {
1051
+ tag: 'div',
1052
+ baseClass: 'skeleton',
1053
+ hasAnimation: true,
1054
+ animationName: 'shimmer',
1055
+ },
1056
+ flutter: {
1057
+ widget: 'Container',
1058
+ props: { color: 'Colors.grey[300]' },
1059
+ },
1060
+ swiftui: {
1061
+ view: 'RoundedRectangle',
1062
+ modifiers: ['.fill(Color.gray.opacity(0.3))', '.shimmering()'],
1063
+ },
1064
+ },
1065
+ };
1066
+ /**
1067
+ * Get component mapping by name (case-insensitive)
1068
+ */
1069
+ export function getComponentMapping(name) {
1070
+ const normalizedName = name.toLowerCase().replace(/[^a-z]/g, '');
1071
+ return COMPONENT_MAPPINGS[normalizedName];
1072
+ }
1073
+ /**
1074
+ * Check if a component name has a mapping
1075
+ */
1076
+ export function hasComponentMapping(name) {
1077
+ return getComponentMapping(name) !== undefined;
1078
+ }
1079
+ /**
1080
+ * Extract component type from name
1081
+ * e.g., "#ButtonPrimary" -> "button", "#CardProduct" -> "card"
1082
+ */
1083
+ export function extractComponentType(name) {
1084
+ // Remove # prefix
1085
+ const cleanName = name.replace(/^#/, '');
1086
+ // Try to match known component types
1087
+ for (const key of Object.keys(COMPONENT_MAPPINGS)) {
1088
+ if (cleanName.toLowerCase().startsWith(key)) {
1089
+ return key;
1090
+ }
1091
+ }
1092
+ return null;
1093
+ }