sh-ui-cli 0.45.2 → 0.46.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/data/changelog/versions.json +26 -0
- package/data/registry/react/components/accordion/index.tailwind.tsx +5 -7
- package/data/registry/react/components/accordion/index.tsx +5 -7
- package/data/registry/react/components/avatar/index.tailwind.tsx +4 -6
- package/data/registry/react/components/avatar/index.tsx +4 -6
- package/data/registry/react/components/badge/index.tailwind.tsx +2 -4
- package/data/registry/react/components/badge/index.tsx +2 -4
- package/data/registry/react/components/breadcrumb/index.tailwind.tsx +8 -10
- package/data/registry/react/components/breadcrumb/index.tsx +8 -10
- package/data/registry/react/components/button/index.module.tsx +45 -0
- package/data/registry/react/components/button/index.tailwind.tsx +2 -1
- package/data/registry/react/components/button/index.tsx +3 -4
- package/data/registry/react/components/button/styles.module.css +92 -0
- package/data/registry/react/components/calendar/index.tailwind.tsx +10 -12
- package/data/registry/react/components/calendar/index.tsx +9 -11
- package/data/registry/react/components/card/index.module.tsx +63 -0
- package/data/registry/react/components/card/index.tailwind.tsx +8 -10
- package/data/registry/react/components/card/index.tsx +8 -10
- package/data/registry/react/components/card/styles.module.css +73 -0
- package/data/registry/react/components/carousel/index.tailwind.tsx +7 -9
- package/data/registry/react/components/carousel/index.tsx +7 -9
- package/data/registry/react/components/checkbox/index.tailwind.tsx +3 -5
- package/data/registry/react/components/checkbox/index.tsx +3 -5
- package/data/registry/react/components/code-editor/index.tailwind.tsx +2 -4
- package/data/registry/react/components/code-editor/index.tsx +2 -4
- package/data/registry/react/components/code-panel/index.tailwind.tsx +5 -7
- package/data/registry/react/components/code-panel/index.tsx +5 -7
- package/data/registry/react/components/color-picker/index.tailwind.tsx +7 -6
- package/data/registry/react/components/color-picker/index.tsx +7 -6
- package/data/registry/react/components/combobox/index.tailwind.tsx +8 -10
- package/data/registry/react/components/combobox/index.tsx +8 -10
- package/data/registry/react/components/context-menu/index.tailwind.tsx +10 -12
- package/data/registry/react/components/context-menu/index.tsx +10 -12
- package/data/registry/react/components/date-picker/index.tailwind.tsx +7 -9
- package/data/registry/react/components/date-picker/index.tsx +7 -9
- package/data/registry/react/components/dialog/index.tailwind.tsx +6 -8
- package/data/registry/react/components/dialog/index.tsx +6 -8
- package/data/registry/react/components/dropdown-menu/index.tailwind.tsx +10 -12
- package/data/registry/react/components/dropdown-menu/index.tsx +10 -12
- package/data/registry/react/components/file-upload/index.tailwind.tsx +6 -8
- package/data/registry/react/components/file-upload/index.tsx +6 -8
- package/data/registry/react/components/form/field.tailwind.tsx +2 -1
- package/data/registry/react/components/form/field.tsx +2 -3
- package/data/registry/react/components/header/index.tailwind.tsx +17 -19
- package/data/registry/react/components/header/index.tsx +17 -19
- package/data/registry/react/components/input/index.module.tsx +486 -0
- package/data/registry/react/components/input/index.tailwind.tsx +4 -6
- package/data/registry/react/components/input/index.tsx +4 -6
- package/data/registry/react/components/input/styles.module.css +200 -0
- package/data/registry/react/components/label/index.tailwind.tsx +6 -8
- package/data/registry/react/components/label/index.tsx +6 -8
- package/data/registry/react/components/markdown-editor/index.tailwind.tsx +2 -4
- package/data/registry/react/components/markdown-editor/index.tsx +2 -4
- package/data/registry/react/components/menubar/index.tailwind.tsx +2 -4
- package/data/registry/react/components/menubar/index.tsx +2 -4
- package/data/registry/react/components/numeric-input/index.tailwind.tsx +2 -4
- package/data/registry/react/components/numeric-input/index.tsx +2 -4
- package/data/registry/react/components/page-toc/index.tailwind.tsx +3 -2
- package/data/registry/react/components/page-toc/index.tsx +2 -3
- package/data/registry/react/components/pagination/index.tailwind.tsx +8 -10
- package/data/registry/react/components/pagination/index.tsx +8 -10
- package/data/registry/react/components/popover/index.tailwind.tsx +4 -6
- package/data/registry/react/components/popover/index.tsx +4 -6
- package/data/registry/react/components/progress/index.tailwind.tsx +3 -5
- package/data/registry/react/components/progress/index.tsx +2 -4
- package/data/registry/react/components/radio/index.tailwind.tsx +3 -5
- package/data/registry/react/components/radio/index.tsx +3 -5
- package/data/registry/react/components/rich-text-editor/index.tailwind.tsx +3 -5
- package/data/registry/react/components/rich-text-editor/index.tsx +3 -5
- package/data/registry/react/components/select/index.tailwind.tsx +8 -10
- package/data/registry/react/components/select/index.tsx +8 -10
- package/data/registry/react/components/separator/index.tailwind.tsx +2 -4
- package/data/registry/react/components/separator/index.tsx +2 -4
- package/data/registry/react/components/sidebar/index.tailwind.tsx +32 -43
- package/data/registry/react/components/sidebar/index.tsx +29 -46
- package/data/registry/react/components/skeleton/index.tailwind.tsx +2 -4
- package/data/registry/react/components/skeleton/index.tsx +2 -4
- package/data/registry/react/components/slider/index.tailwind.tsx +5 -7
- package/data/registry/react/components/slider/index.tsx +5 -7
- package/data/registry/react/components/spinner/index.tailwind.tsx +3 -5
- package/data/registry/react/components/spinner/index.tsx +2 -4
- package/data/registry/react/components/switch/index.tailwind.tsx +3 -5
- package/data/registry/react/components/switch/index.tsx +2 -4
- package/data/registry/react/components/tabs/index.tailwind.tsx +6 -8
- package/data/registry/react/components/tabs/index.tsx +6 -8
- package/data/registry/react/components/textarea/index.tailwind.tsx +2 -4
- package/data/registry/react/components/textarea/index.tsx +2 -4
- package/data/registry/react/components/toggle/index.tailwind.tsx +4 -6
- package/data/registry/react/components/toggle/index.tsx +4 -6
- package/data/registry/react/components/tooltip/index.tailwind.tsx +2 -4
- package/data/registry/react/components/tooltip/index.tsx +2 -4
- package/data/registry/react/lib/cn.tailwind.ts +17 -0
- package/data/registry/react/peer-versions.json +3 -1
- package/data/registry/react/registry.json +202 -43
- package/data/tokens/build.mjs +4 -0
- package/package.json +1 -1
- package/src/add.mjs +37 -13
- package/templates/ui-app-template/sh-ui.config.json +5 -0
|
@@ -25,6 +25,20 @@
|
|
|
25
25
|
"frameworks": [
|
|
26
26
|
"tailwind"
|
|
27
27
|
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"src": "components/button/index.module.tsx",
|
|
31
|
+
"dest": "{components}/button/index.tsx",
|
|
32
|
+
"frameworks": [
|
|
33
|
+
"css-modules"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"src": "components/button/styles.module.css",
|
|
38
|
+
"dest": "{components}/button/styles.module.css",
|
|
39
|
+
"frameworks": [
|
|
40
|
+
"css-modules"
|
|
41
|
+
]
|
|
28
42
|
}
|
|
29
43
|
],
|
|
30
44
|
"dependencies": [
|
|
@@ -35,7 +49,9 @@
|
|
|
35
49
|
]
|
|
36
50
|
}
|
|
37
51
|
],
|
|
38
|
-
"registryDependencies": [
|
|
52
|
+
"registryDependencies": [
|
|
53
|
+
"utils"
|
|
54
|
+
]
|
|
39
55
|
},
|
|
40
56
|
"card": {
|
|
41
57
|
"name": "card",
|
|
@@ -61,10 +77,26 @@
|
|
|
61
77
|
"frameworks": [
|
|
62
78
|
"tailwind"
|
|
63
79
|
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"src": "components/card/index.module.tsx",
|
|
83
|
+
"dest": "{components}/card/index.tsx",
|
|
84
|
+
"frameworks": [
|
|
85
|
+
"css-modules"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"src": "components/card/styles.module.css",
|
|
90
|
+
"dest": "{components}/card/styles.module.css",
|
|
91
|
+
"frameworks": [
|
|
92
|
+
"css-modules"
|
|
93
|
+
]
|
|
64
94
|
}
|
|
65
95
|
],
|
|
66
96
|
"dependencies": [],
|
|
67
|
-
"registryDependencies": [
|
|
97
|
+
"registryDependencies": [
|
|
98
|
+
"utils"
|
|
99
|
+
]
|
|
68
100
|
},
|
|
69
101
|
"input": {
|
|
70
102
|
"name": "input",
|
|
@@ -90,10 +122,26 @@
|
|
|
90
122
|
"frameworks": [
|
|
91
123
|
"tailwind"
|
|
92
124
|
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"src": "components/input/index.module.tsx",
|
|
128
|
+
"dest": "{components}/input/index.tsx",
|
|
129
|
+
"frameworks": [
|
|
130
|
+
"css-modules"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"src": "components/input/styles.module.css",
|
|
135
|
+
"dest": "{components}/input/styles.module.css",
|
|
136
|
+
"frameworks": [
|
|
137
|
+
"css-modules"
|
|
138
|
+
]
|
|
93
139
|
}
|
|
94
140
|
],
|
|
95
141
|
"dependencies": [],
|
|
96
|
-
"registryDependencies": [
|
|
142
|
+
"registryDependencies": [
|
|
143
|
+
"utils"
|
|
144
|
+
]
|
|
97
145
|
},
|
|
98
146
|
"numeric-input": {
|
|
99
147
|
"name": "numeric-input",
|
|
@@ -122,7 +170,9 @@
|
|
|
122
170
|
}
|
|
123
171
|
],
|
|
124
172
|
"dependencies": [],
|
|
125
|
-
"registryDependencies": [
|
|
173
|
+
"registryDependencies": [
|
|
174
|
+
"utils"
|
|
175
|
+
]
|
|
126
176
|
},
|
|
127
177
|
"file-upload": {
|
|
128
178
|
"name": "file-upload",
|
|
@@ -151,7 +201,9 @@
|
|
|
151
201
|
}
|
|
152
202
|
],
|
|
153
203
|
"dependencies": [],
|
|
154
|
-
"registryDependencies": [
|
|
204
|
+
"registryDependencies": [
|
|
205
|
+
"utils"
|
|
206
|
+
]
|
|
155
207
|
},
|
|
156
208
|
"form": {
|
|
157
209
|
"name": "form",
|
|
@@ -240,7 +292,9 @@
|
|
|
240
292
|
}
|
|
241
293
|
],
|
|
242
294
|
"dependencies": [],
|
|
243
|
-
"registryDependencies": [
|
|
295
|
+
"registryDependencies": [
|
|
296
|
+
"utils"
|
|
297
|
+
]
|
|
244
298
|
},
|
|
245
299
|
"form-yup": {
|
|
246
300
|
"name": "form-yup",
|
|
@@ -292,7 +346,9 @@
|
|
|
292
346
|
"dependencies": [
|
|
293
347
|
"shiki"
|
|
294
348
|
],
|
|
295
|
-
"registryDependencies": [
|
|
349
|
+
"registryDependencies": [
|
|
350
|
+
"utils"
|
|
351
|
+
]
|
|
296
352
|
},
|
|
297
353
|
"code-tabs": {
|
|
298
354
|
"name": "code-tabs",
|
|
@@ -336,7 +392,9 @@
|
|
|
336
392
|
}
|
|
337
393
|
],
|
|
338
394
|
"dependencies": [],
|
|
339
|
-
"registryDependencies": [
|
|
395
|
+
"registryDependencies": [
|
|
396
|
+
"utils"
|
|
397
|
+
]
|
|
340
398
|
},
|
|
341
399
|
"code-editor": {
|
|
342
400
|
"name": "code-editor",
|
|
@@ -374,7 +432,9 @@
|
|
|
374
432
|
"@codemirror/lang-html",
|
|
375
433
|
"@codemirror/lang-markdown"
|
|
376
434
|
],
|
|
377
|
-
"registryDependencies": [
|
|
435
|
+
"registryDependencies": [
|
|
436
|
+
"utils"
|
|
437
|
+
]
|
|
378
438
|
},
|
|
379
439
|
"markdown-editor": {
|
|
380
440
|
"name": "markdown-editor",
|
|
@@ -407,7 +467,8 @@
|
|
|
407
467
|
"remark-gfm"
|
|
408
468
|
],
|
|
409
469
|
"registryDependencies": [
|
|
410
|
-
"code-editor"
|
|
470
|
+
"code-editor",
|
|
471
|
+
"utils"
|
|
411
472
|
]
|
|
412
473
|
},
|
|
413
474
|
"rich-text-editor": {
|
|
@@ -444,7 +505,9 @@
|
|
|
444
505
|
"@tiptap/extension-link",
|
|
445
506
|
"lucide-react"
|
|
446
507
|
],
|
|
447
|
-
"registryDependencies": [
|
|
508
|
+
"registryDependencies": [
|
|
509
|
+
"utils"
|
|
510
|
+
]
|
|
448
511
|
},
|
|
449
512
|
"select": {
|
|
450
513
|
"name": "select",
|
|
@@ -475,7 +538,9 @@
|
|
|
475
538
|
"dependencies": [
|
|
476
539
|
"@base-ui/react"
|
|
477
540
|
],
|
|
478
|
-
"registryDependencies": [
|
|
541
|
+
"registryDependencies": [
|
|
542
|
+
"utils"
|
|
543
|
+
]
|
|
479
544
|
},
|
|
480
545
|
"sidebar": {
|
|
481
546
|
"name": "sidebar",
|
|
@@ -507,7 +572,8 @@
|
|
|
507
572
|
"lucide-react"
|
|
508
573
|
],
|
|
509
574
|
"registryDependencies": [
|
|
510
|
-
"popover"
|
|
575
|
+
"popover",
|
|
576
|
+
"utils"
|
|
511
577
|
]
|
|
512
578
|
},
|
|
513
579
|
"header": {
|
|
@@ -537,7 +603,9 @@
|
|
|
537
603
|
}
|
|
538
604
|
],
|
|
539
605
|
"dependencies": [],
|
|
540
|
-
"registryDependencies": [
|
|
606
|
+
"registryDependencies": [
|
|
607
|
+
"utils"
|
|
608
|
+
]
|
|
541
609
|
},
|
|
542
610
|
"base": {
|
|
543
611
|
"name": "base",
|
|
@@ -662,7 +730,9 @@
|
|
|
662
730
|
}
|
|
663
731
|
],
|
|
664
732
|
"dependencies": [],
|
|
665
|
-
"registryDependencies": [
|
|
733
|
+
"registryDependencies": [
|
|
734
|
+
"utils"
|
|
735
|
+
]
|
|
666
736
|
},
|
|
667
737
|
"color-picker": {
|
|
668
738
|
"name": "color-picker",
|
|
@@ -691,7 +761,9 @@
|
|
|
691
761
|
}
|
|
692
762
|
],
|
|
693
763
|
"dependencies": [],
|
|
694
|
-
"registryDependencies": [
|
|
764
|
+
"registryDependencies": [
|
|
765
|
+
"utils"
|
|
766
|
+
]
|
|
695
767
|
},
|
|
696
768
|
"slider": {
|
|
697
769
|
"name": "slider",
|
|
@@ -720,7 +792,9 @@
|
|
|
720
792
|
}
|
|
721
793
|
],
|
|
722
794
|
"dependencies": [],
|
|
723
|
-
"registryDependencies": [
|
|
795
|
+
"registryDependencies": [
|
|
796
|
+
"utils"
|
|
797
|
+
]
|
|
724
798
|
},
|
|
725
799
|
"tabs": {
|
|
726
800
|
"name": "tabs",
|
|
@@ -751,7 +825,9 @@
|
|
|
751
825
|
"dependencies": [
|
|
752
826
|
"@base-ui/react"
|
|
753
827
|
],
|
|
754
|
-
"registryDependencies": [
|
|
828
|
+
"registryDependencies": [
|
|
829
|
+
"utils"
|
|
830
|
+
]
|
|
755
831
|
},
|
|
756
832
|
"combobox": {
|
|
757
833
|
"name": "combobox",
|
|
@@ -782,7 +858,9 @@
|
|
|
782
858
|
"dependencies": [
|
|
783
859
|
"@base-ui/react"
|
|
784
860
|
],
|
|
785
|
-
"registryDependencies": [
|
|
861
|
+
"registryDependencies": [
|
|
862
|
+
"utils"
|
|
863
|
+
]
|
|
786
864
|
},
|
|
787
865
|
"popover": {
|
|
788
866
|
"name": "popover",
|
|
@@ -813,7 +891,9 @@
|
|
|
813
891
|
"dependencies": [
|
|
814
892
|
"@base-ui/react"
|
|
815
893
|
],
|
|
816
|
-
"registryDependencies": [
|
|
894
|
+
"registryDependencies": [
|
|
895
|
+
"utils"
|
|
896
|
+
]
|
|
817
897
|
},
|
|
818
898
|
"dialog": {
|
|
819
899
|
"name": "dialog",
|
|
@@ -844,7 +924,9 @@
|
|
|
844
924
|
"dependencies": [
|
|
845
925
|
"@base-ui/react"
|
|
846
926
|
],
|
|
847
|
-
"registryDependencies": [
|
|
927
|
+
"registryDependencies": [
|
|
928
|
+
"utils"
|
|
929
|
+
]
|
|
848
930
|
},
|
|
849
931
|
"dropdown-menu": {
|
|
850
932
|
"name": "dropdown-menu",
|
|
@@ -875,7 +957,9 @@
|
|
|
875
957
|
"dependencies": [
|
|
876
958
|
"@base-ui/react"
|
|
877
959
|
],
|
|
878
|
-
"registryDependencies": [
|
|
960
|
+
"registryDependencies": [
|
|
961
|
+
"utils"
|
|
962
|
+
]
|
|
879
963
|
},
|
|
880
964
|
"context-menu": {
|
|
881
965
|
"name": "context-menu",
|
|
@@ -906,7 +990,9 @@
|
|
|
906
990
|
"dependencies": [
|
|
907
991
|
"@base-ui/react"
|
|
908
992
|
],
|
|
909
|
-
"registryDependencies": [
|
|
993
|
+
"registryDependencies": [
|
|
994
|
+
"utils"
|
|
995
|
+
]
|
|
910
996
|
},
|
|
911
997
|
"menubar": {
|
|
912
998
|
"name": "menubar",
|
|
@@ -938,7 +1024,8 @@
|
|
|
938
1024
|
"@base-ui/react"
|
|
939
1025
|
],
|
|
940
1026
|
"registryDependencies": [
|
|
941
|
-
"dropdown-menu"
|
|
1027
|
+
"dropdown-menu",
|
|
1028
|
+
"utils"
|
|
942
1029
|
]
|
|
943
1030
|
},
|
|
944
1031
|
"tooltip": {
|
|
@@ -970,7 +1057,9 @@
|
|
|
970
1057
|
"dependencies": [
|
|
971
1058
|
"@base-ui/react"
|
|
972
1059
|
],
|
|
973
|
-
"registryDependencies": [
|
|
1060
|
+
"registryDependencies": [
|
|
1061
|
+
"utils"
|
|
1062
|
+
]
|
|
974
1063
|
},
|
|
975
1064
|
"breadcrumb": {
|
|
976
1065
|
"name": "breadcrumb",
|
|
@@ -999,7 +1088,9 @@
|
|
|
999
1088
|
}
|
|
1000
1089
|
],
|
|
1001
1090
|
"dependencies": [],
|
|
1002
|
-
"registryDependencies": [
|
|
1091
|
+
"registryDependencies": [
|
|
1092
|
+
"utils"
|
|
1093
|
+
]
|
|
1003
1094
|
},
|
|
1004
1095
|
"pagination": {
|
|
1005
1096
|
"name": "pagination",
|
|
@@ -1028,7 +1119,9 @@
|
|
|
1028
1119
|
}
|
|
1029
1120
|
],
|
|
1030
1121
|
"dependencies": [],
|
|
1031
|
-
"registryDependencies": [
|
|
1122
|
+
"registryDependencies": [
|
|
1123
|
+
"utils"
|
|
1124
|
+
]
|
|
1032
1125
|
},
|
|
1033
1126
|
"avatar": {
|
|
1034
1127
|
"name": "avatar",
|
|
@@ -1065,7 +1158,9 @@
|
|
|
1065
1158
|
]
|
|
1066
1159
|
}
|
|
1067
1160
|
],
|
|
1068
|
-
"registryDependencies": [
|
|
1161
|
+
"registryDependencies": [
|
|
1162
|
+
"utils"
|
|
1163
|
+
]
|
|
1069
1164
|
},
|
|
1070
1165
|
"badge": {
|
|
1071
1166
|
"name": "badge",
|
|
@@ -1101,7 +1196,9 @@
|
|
|
1101
1196
|
]
|
|
1102
1197
|
}
|
|
1103
1198
|
],
|
|
1104
|
-
"registryDependencies": [
|
|
1199
|
+
"registryDependencies": [
|
|
1200
|
+
"utils"
|
|
1201
|
+
]
|
|
1105
1202
|
},
|
|
1106
1203
|
"progress": {
|
|
1107
1204
|
"name": "progress",
|
|
@@ -1130,7 +1227,9 @@
|
|
|
1130
1227
|
}
|
|
1131
1228
|
],
|
|
1132
1229
|
"dependencies": [],
|
|
1133
|
-
"registryDependencies": [
|
|
1230
|
+
"registryDependencies": [
|
|
1231
|
+
"utils"
|
|
1232
|
+
]
|
|
1134
1233
|
},
|
|
1135
1234
|
"spinner": {
|
|
1136
1235
|
"name": "spinner",
|
|
@@ -1166,7 +1265,9 @@
|
|
|
1166
1265
|
]
|
|
1167
1266
|
}
|
|
1168
1267
|
],
|
|
1169
|
-
"registryDependencies": [
|
|
1268
|
+
"registryDependencies": [
|
|
1269
|
+
"utils"
|
|
1270
|
+
]
|
|
1170
1271
|
},
|
|
1171
1272
|
"separator": {
|
|
1172
1273
|
"name": "separator",
|
|
@@ -1195,7 +1296,9 @@
|
|
|
1195
1296
|
}
|
|
1196
1297
|
],
|
|
1197
1298
|
"dependencies": [],
|
|
1198
|
-
"registryDependencies": [
|
|
1299
|
+
"registryDependencies": [
|
|
1300
|
+
"utils"
|
|
1301
|
+
]
|
|
1199
1302
|
},
|
|
1200
1303
|
"theme": {
|
|
1201
1304
|
"name": "theme",
|
|
@@ -1238,7 +1341,9 @@
|
|
|
1238
1341
|
"dependencies": [
|
|
1239
1342
|
"@base-ui/react"
|
|
1240
1343
|
],
|
|
1241
|
-
"registryDependencies": [
|
|
1344
|
+
"registryDependencies": [
|
|
1345
|
+
"utils"
|
|
1346
|
+
]
|
|
1242
1347
|
},
|
|
1243
1348
|
"radio": {
|
|
1244
1349
|
"name": "radio",
|
|
@@ -1269,7 +1374,9 @@
|
|
|
1269
1374
|
"dependencies": [
|
|
1270
1375
|
"@base-ui/react"
|
|
1271
1376
|
],
|
|
1272
|
-
"registryDependencies": [
|
|
1377
|
+
"registryDependencies": [
|
|
1378
|
+
"utils"
|
|
1379
|
+
]
|
|
1273
1380
|
},
|
|
1274
1381
|
"switch": {
|
|
1275
1382
|
"name": "switch",
|
|
@@ -1306,7 +1413,9 @@
|
|
|
1306
1413
|
]
|
|
1307
1414
|
}
|
|
1308
1415
|
],
|
|
1309
|
-
"registryDependencies": [
|
|
1416
|
+
"registryDependencies": [
|
|
1417
|
+
"utils"
|
|
1418
|
+
]
|
|
1310
1419
|
},
|
|
1311
1420
|
"toggle": {
|
|
1312
1421
|
"name": "toggle",
|
|
@@ -1343,7 +1452,9 @@
|
|
|
1343
1452
|
]
|
|
1344
1453
|
}
|
|
1345
1454
|
],
|
|
1346
|
-
"registryDependencies": [
|
|
1455
|
+
"registryDependencies": [
|
|
1456
|
+
"utils"
|
|
1457
|
+
]
|
|
1347
1458
|
},
|
|
1348
1459
|
"textarea": {
|
|
1349
1460
|
"name": "textarea",
|
|
@@ -1372,7 +1483,9 @@
|
|
|
1372
1483
|
}
|
|
1373
1484
|
],
|
|
1374
1485
|
"dependencies": [],
|
|
1375
|
-
"registryDependencies": [
|
|
1486
|
+
"registryDependencies": [
|
|
1487
|
+
"utils"
|
|
1488
|
+
]
|
|
1376
1489
|
},
|
|
1377
1490
|
"toast": {
|
|
1378
1491
|
"name": "toast",
|
|
@@ -1401,7 +1514,9 @@
|
|
|
1401
1514
|
}
|
|
1402
1515
|
],
|
|
1403
1516
|
"dependencies": [],
|
|
1404
|
-
"registryDependencies": [
|
|
1517
|
+
"registryDependencies": [
|
|
1518
|
+
"utils"
|
|
1519
|
+
]
|
|
1405
1520
|
},
|
|
1406
1521
|
"calendar": {
|
|
1407
1522
|
"name": "calendar",
|
|
@@ -1431,7 +1546,8 @@
|
|
|
1431
1546
|
],
|
|
1432
1547
|
"dependencies": [],
|
|
1433
1548
|
"registryDependencies": [
|
|
1434
|
-
"select"
|
|
1549
|
+
"select",
|
|
1550
|
+
"utils"
|
|
1435
1551
|
]
|
|
1436
1552
|
},
|
|
1437
1553
|
"date-picker": {
|
|
@@ -1464,7 +1580,8 @@
|
|
|
1464
1580
|
"@base-ui/react"
|
|
1465
1581
|
],
|
|
1466
1582
|
"registryDependencies": [
|
|
1467
|
-
"calendar"
|
|
1583
|
+
"calendar",
|
|
1584
|
+
"utils"
|
|
1468
1585
|
]
|
|
1469
1586
|
},
|
|
1470
1587
|
"skeleton": {
|
|
@@ -1494,7 +1611,9 @@
|
|
|
1494
1611
|
}
|
|
1495
1612
|
],
|
|
1496
1613
|
"dependencies": [],
|
|
1497
|
-
"registryDependencies": [
|
|
1614
|
+
"registryDependencies": [
|
|
1615
|
+
"utils"
|
|
1616
|
+
]
|
|
1498
1617
|
},
|
|
1499
1618
|
"accordion": {
|
|
1500
1619
|
"name": "accordion",
|
|
@@ -1525,7 +1644,9 @@
|
|
|
1525
1644
|
"dependencies": [
|
|
1526
1645
|
"@base-ui/react"
|
|
1527
1646
|
],
|
|
1528
|
-
"registryDependencies": [
|
|
1647
|
+
"registryDependencies": [
|
|
1648
|
+
"utils"
|
|
1649
|
+
]
|
|
1529
1650
|
},
|
|
1530
1651
|
"carousel": {
|
|
1531
1652
|
"name": "carousel",
|
|
@@ -1554,7 +1675,9 @@
|
|
|
1554
1675
|
}
|
|
1555
1676
|
],
|
|
1556
1677
|
"dependencies": [],
|
|
1557
|
-
"registryDependencies": [
|
|
1678
|
+
"registryDependencies": [
|
|
1679
|
+
"utils"
|
|
1680
|
+
]
|
|
1558
1681
|
},
|
|
1559
1682
|
"form-rhf": {
|
|
1560
1683
|
"name": "form-rhf",
|
|
@@ -1587,6 +1710,42 @@
|
|
|
1587
1710
|
"registryDependencies": [
|
|
1588
1711
|
"form"
|
|
1589
1712
|
]
|
|
1713
|
+
},
|
|
1714
|
+
"utils": {
|
|
1715
|
+
"name": "utils",
|
|
1716
|
+
"type": "lib",
|
|
1717
|
+
"files": [
|
|
1718
|
+
{
|
|
1719
|
+
"src": "lib/cn.ts",
|
|
1720
|
+
"dest": "{utils}",
|
|
1721
|
+
"frameworks": [
|
|
1722
|
+
"plain",
|
|
1723
|
+
"css-modules"
|
|
1724
|
+
]
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
"src": "lib/cn.tailwind.ts",
|
|
1728
|
+
"dest": "{utils}",
|
|
1729
|
+
"frameworks": [
|
|
1730
|
+
"tailwind"
|
|
1731
|
+
]
|
|
1732
|
+
}
|
|
1733
|
+
],
|
|
1734
|
+
"dependencies": [
|
|
1735
|
+
{
|
|
1736
|
+
"name": "clsx",
|
|
1737
|
+
"frameworks": [
|
|
1738
|
+
"tailwind"
|
|
1739
|
+
]
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
"name": "tailwind-merge",
|
|
1743
|
+
"frameworks": [
|
|
1744
|
+
"tailwind"
|
|
1745
|
+
]
|
|
1746
|
+
}
|
|
1747
|
+
],
|
|
1748
|
+
"registryDependencies": []
|
|
1590
1749
|
}
|
|
1591
1750
|
}
|
|
1592
1751
|
}
|
package/data/tokens/build.mjs
CHANGED
|
@@ -574,6 +574,10 @@ const tokenEmitters = {
|
|
|
574
574
|
// 동일. 향후 Tailwind v3 theme.config.ts 를 별도 emit 하고 싶으면
|
|
575
575
|
// 여기에 다른 함수를 등록.
|
|
576
576
|
tailwind: buildTokensCss,
|
|
577
|
+
// CSS Modules 변종도 토큰은 평문 CSS custom properties — :root 변수를
|
|
578
|
+
// 그대로 참조하면 되므로 tokens.css 를 공유. .module.css 안에서도
|
|
579
|
+
// var(--primary) 같은 글로벌 변수는 정상 참조됨.
|
|
580
|
+
"css-modules": buildTokensCss,
|
|
577
581
|
},
|
|
578
582
|
flutter: {
|
|
579
583
|
plain: buildTokensDart,
|
package/package.json
CHANGED
package/src/add.mjs
CHANGED
|
@@ -84,6 +84,29 @@ function resolveDest(template, config) {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* registry source 안의 placeholder 를 사용자 config 값으로 치환.
|
|
89
|
+
* 현재 지원: `@SH_UI_UTILS@` → `aliases.utils` (예: `@/src/shared/lib/utils`).
|
|
90
|
+
*
|
|
91
|
+
* registry 컴포넌트는 cn 유틸을 `import { cn } from "@SH_UI_UTILS@"` 로 import 한다 —
|
|
92
|
+
* CLI 가 add 시점에 사용자 프로젝트의 alias 로 치환해 TS module resolution 이 동작.
|
|
93
|
+
*
|
|
94
|
+
* aliases.utils 가 미설정인데 placeholder 가 등장하면 친절 에러로 안내. 사용자가 매 컴포넌트
|
|
95
|
+
* 추가 후 import 깨진 것을 발견하기 전에 시점에 잡는다.
|
|
96
|
+
*/
|
|
97
|
+
function substitutePlaceholders(content, config, srcRel) {
|
|
98
|
+
const PLACEHOLDER = "@SH_UI_UTILS@";
|
|
99
|
+
if (!content.includes(PLACEHOLDER)) return content;
|
|
100
|
+
const alias = config.aliases?.utils;
|
|
101
|
+
if (!alias) {
|
|
102
|
+
throw new Error(
|
|
103
|
+
`${srcRel} 가 cn 유틸을 import 합니다. sh-ui.config.json 에 aliases.utils 를 설정하세요.\n` +
|
|
104
|
+
` 예: "aliases": { "utils": "@/src/lib/utils" }`,
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return content.replaceAll(PLACEHOLDER, alias);
|
|
108
|
+
}
|
|
109
|
+
|
|
87
110
|
async function ensureDir(filePath) {
|
|
88
111
|
await mkdir(dirname(filePath), { recursive: true });
|
|
89
112
|
}
|
|
@@ -170,19 +193,19 @@ function frameworkMatches(entry, cssFramework) {
|
|
|
170
193
|
}
|
|
171
194
|
|
|
172
195
|
/**
|
|
173
|
-
*
|
|
174
|
-
* plain
|
|
175
|
-
*
|
|
196
|
+
* 컴포넌트에 요청된 cssFramework 전용 변종 파일이 없으면 plain 으로 fallback.
|
|
197
|
+
* plain CSS 컴포넌트는 :root 변수만 의존하므로 어떤 환경(Tailwind v4, CSS Modules,
|
|
198
|
+
* vanilla CSS) 에서도 그대로 동작 — 깨지지 않음.
|
|
176
199
|
*
|
|
177
|
-
* 점진적 rollout 전략 — 모든 컴포넌트가 한 번에
|
|
178
|
-
* 가능한 것부터
|
|
200
|
+
* 점진적 rollout 전략 — 모든 컴포넌트가 한 번에 새 변종을 갖출 필요 없이
|
|
201
|
+
* 가능한 것부터 변종을 제공하고, 나머지는 plain 으로 자연 처리.
|
|
179
202
|
*/
|
|
180
203
|
function effectiveFramework(entry, cssFramework) {
|
|
181
|
-
if (cssFramework
|
|
182
|
-
const
|
|
183
|
-
(f) => f.frameworks && f.frameworks.includes(
|
|
204
|
+
if (cssFramework === "plain") return cssFramework;
|
|
205
|
+
const hasVariant = (entry.files ?? []).some(
|
|
206
|
+
(f) => f.frameworks && f.frameworks.includes(cssFramework),
|
|
184
207
|
);
|
|
185
|
-
return
|
|
208
|
+
return hasVariant ? cssFramework : "plain";
|
|
186
209
|
}
|
|
187
210
|
|
|
188
211
|
async function addComponent(name, config, cwd, installed, pendingDeps, diffMode, summary, conflictResolver) {
|
|
@@ -200,11 +223,11 @@ async function addComponent(name, config, cwd, installed, pendingDeps, diffMode,
|
|
|
200
223
|
const requestedFw = config.cssFramework ?? "plain";
|
|
201
224
|
const cssFramework = effectiveFramework(entry, requestedFw);
|
|
202
225
|
|
|
203
|
-
// 사용자가
|
|
226
|
+
// 사용자가 plain 외 변종을 골랐는데 이 컴포넌트는 plain 으로 fallback 된 경우 한 줄 알림.
|
|
204
227
|
// 동작에 문제는 없지만 일관성에 대한 기대를 정확히 셋업하기 위함.
|
|
205
|
-
if (requestedFw
|
|
228
|
+
if (requestedFw !== "plain" && cssFramework === "plain" && !diffMode) {
|
|
206
229
|
console.log(
|
|
207
|
-
`ℹ ${name} —
|
|
230
|
+
`ℹ ${name} — ${requestedFw} 변종 미제공, plain 변종으로 설치 (어떤 환경에서도 그대로 동작)`,
|
|
208
231
|
);
|
|
209
232
|
}
|
|
210
233
|
|
|
@@ -223,7 +246,8 @@ async function addComponent(name, config, cwd, installed, pendingDeps, diffMode,
|
|
|
223
246
|
if (!frameworkMatches(file, cssFramework)) continue;
|
|
224
247
|
const src = resolve(registryRoot, file.src);
|
|
225
248
|
const dest = resolve(cwd, resolveDest(file.dest, config));
|
|
226
|
-
const
|
|
249
|
+
const raw = await readFile(src, "utf8");
|
|
250
|
+
const content = substitutePlaceholders(raw, config, file.src);
|
|
227
251
|
const result = await writeOrDiff({ dest, content, cwd, diffMode, summary, conflictResolver });
|
|
228
252
|
if (!diffMode && result !== "unchanged") {
|
|
229
253
|
const prefix = result === "kept" ? "↷" : "✓";
|