sh-ui-cli 0.14.0 → 0.21.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/bin/sh-ui.mjs +6 -0
- package/data/changelog/versions.json +354 -0
- package/data/registry/flutter/foundation/sh_ui_tokens.dart +385 -0
- package/data/registry/flutter/registry.json +336 -0
- package/data/registry/flutter/widgets/sh_ui_accordion.dart +255 -0
- package/data/registry/flutter/widgets/sh_ui_app_shell.dart +267 -0
- package/data/registry/flutter/widgets/sh_ui_avatar.dart +95 -0
- package/data/registry/flutter/widgets/sh_ui_badge.dart +82 -0
- package/data/registry/flutter/widgets/sh_ui_breadcrumb.dart +107 -0
- package/data/registry/flutter/widgets/sh_ui_button.dart +201 -0
- package/data/registry/flutter/widgets/sh_ui_card.dart +159 -0
- package/data/registry/flutter/widgets/sh_ui_carousel.dart +204 -0
- package/data/registry/flutter/widgets/sh_ui_checkbox.dart +154 -0
- package/data/registry/flutter/widgets/sh_ui_color_picker.dart +264 -0
- package/data/registry/flutter/widgets/sh_ui_combobox.dart +614 -0
- package/data/registry/flutter/widgets/sh_ui_context_menu.dart +71 -0
- package/data/registry/flutter/widgets/sh_ui_date_picker.dart +648 -0
- package/data/registry/flutter/widgets/sh_ui_dialog.dart +567 -0
- package/data/registry/flutter/widgets/sh_ui_dropdown_menu.dart +251 -0
- package/data/registry/flutter/widgets/sh_ui_file_upload.dart +200 -0
- package/data/registry/flutter/widgets/sh_ui_header.dart +488 -0
- package/data/registry/flutter/widgets/sh_ui_input.dart +664 -0
- package/data/registry/flutter/widgets/sh_ui_label.dart +145 -0
- package/data/registry/flutter/widgets/sh_ui_menubar.dart +98 -0
- package/data/registry/flutter/widgets/sh_ui_pagination.dart +276 -0
- package/data/registry/flutter/widgets/sh_ui_popover.dart +248 -0
- package/data/registry/flutter/widgets/sh_ui_progress.dart +47 -0
- package/data/registry/flutter/widgets/sh_ui_radio.dart +108 -0
- package/data/registry/flutter/widgets/sh_ui_select.dart +904 -0
- package/data/registry/flutter/widgets/sh_ui_separator.dart +42 -0
- package/data/registry/flutter/widgets/sh_ui_sidebar.dart +1116 -0
- package/data/registry/flutter/widgets/sh_ui_skeleton.dart +129 -0
- package/data/registry/flutter/widgets/sh_ui_slider.dart +147 -0
- package/data/registry/flutter/widgets/sh_ui_spinner.dart +56 -0
- package/data/registry/flutter/widgets/sh_ui_switch.dart +109 -0
- package/data/registry/flutter/widgets/sh_ui_tabs.dart +329 -0
- package/data/registry/flutter/widgets/sh_ui_textarea.dart +126 -0
- package/data/registry/flutter/widgets/sh_ui_toast.dart +362 -0
- package/data/registry/flutter/widgets/sh_ui_toggle.dart +229 -0
- package/data/registry/flutter/widgets/sh_ui_tooltip.dart +62 -0
- package/data/registry/react/components/accordion/index.tsx +85 -0
- package/data/registry/react/components/accordion/styles.css +94 -0
- package/data/registry/react/components/animations/animations.css +51 -0
- package/data/registry/react/components/avatar/index.tsx +75 -0
- package/data/registry/react/components/avatar/styles.css +36 -0
- package/data/registry/react/components/badge/index.tsx +42 -0
- package/data/registry/react/components/badge/styles.css +57 -0
- package/data/registry/react/components/base/base.css +102 -0
- package/data/registry/react/components/breadcrumb/index.tsx +154 -0
- package/data/registry/react/components/breadcrumb/styles.css +82 -0
- package/data/registry/react/components/breakpoints/breakpoints.css +17 -0
- package/data/registry/react/components/button/index.tsx +47 -0
- package/data/registry/react/components/button/styles.css +93 -0
- package/data/registry/react/components/card/index.tsx +86 -0
- package/data/registry/react/components/card/styles.css +73 -0
- package/data/registry/react/components/carousel/index.tsx +432 -0
- package/data/registry/react/components/carousel/styles.css +155 -0
- package/data/registry/react/components/checkbox/index.tsx +98 -0
- package/data/registry/react/components/checkbox/styles.css +75 -0
- package/data/registry/react/components/code-panel/copy.tsx +56 -0
- package/data/registry/react/components/code-panel/index.tsx +193 -0
- package/data/registry/react/components/code-panel/styles.css +124 -0
- package/data/registry/react/components/color-picker/index.tsx +466 -0
- package/data/registry/react/components/color-picker/styles.css +166 -0
- package/data/registry/react/components/combobox/index.tsx +167 -0
- package/data/registry/react/components/combobox/styles.css +151 -0
- package/data/registry/react/components/context-menu/index.tsx +253 -0
- package/data/registry/react/components/context-menu/styles.css +140 -0
- package/data/registry/react/components/date-picker/index.tsx +757 -0
- package/data/registry/react/components/date-picker/styles.css +279 -0
- package/data/registry/react/components/dialog/index.tsx +97 -0
- package/data/registry/react/components/dialog/styles.css +127 -0
- package/data/registry/react/components/dropdown-menu/index.tsx +257 -0
- package/data/registry/react/components/dropdown-menu/styles.css +150 -0
- package/data/registry/react/components/file-upload/index.tsx +489 -0
- package/data/registry/react/components/file-upload/styles.css +170 -0
- package/data/registry/react/components/focus-ring/focus-ring.css +23 -0
- package/data/registry/react/components/form/context.ts +92 -0
- package/data/registry/react/components/form/field.test.tsx +230 -0
- package/data/registry/react/components/form/field.tsx +236 -0
- package/data/registry/react/components/form/focus-first-error.ts +54 -0
- package/data/registry/react/components/form/form.section.test.tsx +58 -0
- package/data/registry/react/components/form/form.test.tsx +146 -0
- package/data/registry/react/components/form/form.tsx +180 -0
- package/data/registry/react/components/form/index.tsx +61 -0
- package/data/registry/react/components/form/steps.test.tsx +106 -0
- package/data/registry/react/components/form/steps.tsx +193 -0
- package/data/registry/react/components/form/store.test.ts +206 -0
- package/data/registry/react/components/form/store.ts +318 -0
- package/data/registry/react/components/form/styles.css +47 -0
- package/data/registry/react/components/form/types.ts +104 -0
- package/data/registry/react/components/form/use-sh-ui-form.ts +15 -0
- package/data/registry/react/components/form/utils.test.ts +44 -0
- package/data/registry/react/components/form/utils.ts +49 -0
- package/data/registry/react/components/form/validation.test.ts +67 -0
- package/data/registry/react/components/form/validation.ts +64 -0
- package/data/registry/react/components/form-rhf/README.md +27 -0
- package/data/registry/react/components/form-rhf/index.tsx +289 -0
- package/data/registry/react/components/form-rhf/rhf.test.tsx +42 -0
- package/data/registry/react/components/form-tanstack/README.md +27 -0
- package/data/registry/react/components/form-tanstack/index.tsx +352 -0
- package/data/registry/react/components/form-tanstack/tanstack.test.tsx +45 -0
- package/data/registry/react/components/form-yup/README.md +22 -0
- package/data/registry/react/components/form-yup/index.tsx +50 -0
- package/data/registry/react/components/form-yup/yup.test.ts +27 -0
- package/data/registry/react/components/header/index.tsx +257 -0
- package/data/registry/react/components/header/styles.css +190 -0
- package/data/registry/react/components/input/index.tsx +517 -0
- package/data/registry/react/components/input/styles.css +203 -0
- package/data/registry/react/components/label/index.tsx +54 -0
- package/data/registry/react/components/label/styles.css +90 -0
- package/data/registry/react/components/menubar/index.tsx +34 -0
- package/data/registry/react/components/menubar/styles.css +45 -0
- package/data/registry/react/components/pagination/index.tsx +271 -0
- package/data/registry/react/components/pagination/styles.css +105 -0
- package/data/registry/react/components/popover/index.tsx +115 -0
- package/data/registry/react/components/popover/styles.css +65 -0
- package/data/registry/react/components/progress/index.tsx +56 -0
- package/data/registry/react/components/progress/styles.css +41 -0
- package/data/registry/react/components/radio/index.tsx +67 -0
- package/data/registry/react/components/radio/styles.css +80 -0
- package/data/registry/react/components/select/index.tsx +236 -0
- package/data/registry/react/components/select/styles.css +193 -0
- package/data/registry/react/components/separator/index.tsx +48 -0
- package/data/registry/react/components/separator/styles.css +15 -0
- package/data/registry/react/components/sidebar/index.tsx +1084 -0
- package/data/registry/react/components/sidebar/styles.css +502 -0
- package/data/registry/react/components/skeleton/index.tsx +24 -0
- package/data/registry/react/components/skeleton/styles.css +24 -0
- package/data/registry/react/components/slider/index.tsx +300 -0
- package/data/registry/react/components/slider/styles.css +64 -0
- package/data/registry/react/components/spinner/index.tsx +40 -0
- package/data/registry/react/components/spinner/styles.css +37 -0
- package/data/registry/react/components/switch/index.tsx +41 -0
- package/data/registry/react/components/switch/styles.css +83 -0
- package/data/registry/react/components/tabs/index.tsx +93 -0
- package/data/registry/react/components/tabs/styles.css +148 -0
- package/data/registry/react/components/textarea/index.tsx +25 -0
- package/data/registry/react/components/textarea/styles.css +54 -0
- package/data/registry/react/components/theme/index.tsx +91 -0
- package/data/registry/react/components/toast/index.tsx +257 -0
- package/data/registry/react/components/toast/styles.css +290 -0
- package/data/registry/react/components/toggle/index.tsx +133 -0
- package/data/registry/react/components/toggle/styles.css +85 -0
- package/data/registry/react/components/tooltip/index.tsx +85 -0
- package/data/registry/react/components/tooltip/styles.css +44 -0
- package/data/registry/react/components/z-index/z-index.css +16 -0
- package/data/registry/react/hooks/use-active-section.ts +104 -0
- package/data/registry/react/hooks/use-media-query.ts +27 -0
- package/data/registry/react/lib/cn.ts +39 -0
- package/data/registry/react/registry.json +835 -0
- package/data/summaries/flutter.json +42 -0
- package/data/summaries/react.json +50 -0
- package/data/tokens/build.mjs +553 -0
- package/data/tokens/src/primitives.json +146 -0
- package/data/tokens/src/semantic.json +146 -0
- package/package.json +13 -4
- package/src/add.mjs +13 -12
- package/src/list.mjs +3 -11
- package/src/mcp.mjs +308 -0
- package/src/paths.mjs +52 -0
- package/src/remove.mjs +4 -11
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "원시 토큰 — 실제 값. 플랫폼/테마 무관. W3C Design Tokens 포맷 준수.",
|
|
3
|
+
"color": {
|
|
4
|
+
"white": { "$value": "#FFFFFF", "$type": "color" },
|
|
5
|
+
"black": { "$value": "#000000", "$type": "color" },
|
|
6
|
+
|
|
7
|
+
"neutral": {
|
|
8
|
+
"50": { "$value": "#FAFAFA", "$type": "color" },
|
|
9
|
+
"100": { "$value": "#F5F5F5", "$type": "color" },
|
|
10
|
+
"200": { "$value": "#E5E5E5", "$type": "color" },
|
|
11
|
+
"300": { "$value": "#D4D4D4", "$type": "color" },
|
|
12
|
+
"400": { "$value": "#A3A3A3", "$type": "color" },
|
|
13
|
+
"500": { "$value": "#737373", "$type": "color" },
|
|
14
|
+
"600": { "$value": "#525252", "$type": "color" },
|
|
15
|
+
"700": { "$value": "#404040", "$type": "color" },
|
|
16
|
+
"800": { "$value": "#262626", "$type": "color" },
|
|
17
|
+
"900": { "$value": "#171717", "$type": "color" },
|
|
18
|
+
"950": { "$value": "#0A0A0A", "$type": "color" }
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
"zinc": {
|
|
22
|
+
"50": { "$value": "#FAFAFA", "$type": "color" },
|
|
23
|
+
"100": { "$value": "#F4F4F5", "$type": "color" },
|
|
24
|
+
"200": { "$value": "#E4E4E7", "$type": "color" },
|
|
25
|
+
"300": { "$value": "#D4D4D8", "$type": "color" },
|
|
26
|
+
"400": { "$value": "#A1A1AA", "$type": "color" },
|
|
27
|
+
"500": { "$value": "#71717A", "$type": "color" },
|
|
28
|
+
"600": { "$value": "#52525B", "$type": "color" },
|
|
29
|
+
"700": { "$value": "#3F3F46", "$type": "color" },
|
|
30
|
+
"800": { "$value": "#27272A", "$type": "color" },
|
|
31
|
+
"900": { "$value": "#18181B", "$type": "color" },
|
|
32
|
+
"950": { "$value": "#09090B", "$type": "color" }
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"slate": {
|
|
36
|
+
"50": { "$value": "#F8FAFC", "$type": "color" },
|
|
37
|
+
"100": { "$value": "#F1F5F9", "$type": "color" },
|
|
38
|
+
"200": { "$value": "#E2E8F0", "$type": "color" },
|
|
39
|
+
"300": { "$value": "#CBD5E1", "$type": "color" },
|
|
40
|
+
"400": { "$value": "#94A3B8", "$type": "color" },
|
|
41
|
+
"500": { "$value": "#64748B", "$type": "color" },
|
|
42
|
+
"600": { "$value": "#475569", "$type": "color" },
|
|
43
|
+
"700": { "$value": "#334155", "$type": "color" },
|
|
44
|
+
"800": { "$value": "#1E293B", "$type": "color" },
|
|
45
|
+
"900": { "$value": "#0F172A", "$type": "color" },
|
|
46
|
+
"950": { "$value": "#020617", "$type": "color" }
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
"red": {
|
|
50
|
+
"500": { "$value": "#EF4444", "$type": "color" },
|
|
51
|
+
"600": { "$value": "#DC2626", "$type": "color" }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
"spacing": {
|
|
56
|
+
"0": { "$value": "0px", "$type": "dimension" },
|
|
57
|
+
"1": { "$value": "4px", "$type": "dimension" },
|
|
58
|
+
"2": { "$value": "8px", "$type": "dimension" },
|
|
59
|
+
"3": { "$value": "12px", "$type": "dimension" },
|
|
60
|
+
"4": { "$value": "16px", "$type": "dimension" },
|
|
61
|
+
"5": { "$value": "20px", "$type": "dimension" },
|
|
62
|
+
"6": { "$value": "24px", "$type": "dimension" },
|
|
63
|
+
"8": { "$value": "32px", "$type": "dimension" },
|
|
64
|
+
"10": { "$value": "40px", "$type": "dimension" },
|
|
65
|
+
"12": { "$value": "48px", "$type": "dimension" },
|
|
66
|
+
"16": { "$value": "64px", "$type": "dimension" }
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
"radius": {
|
|
70
|
+
"none": { "$value": "0px", "$type": "dimension" },
|
|
71
|
+
"sm": { "$value": "0.25rem","$type": "dimension" },
|
|
72
|
+
"md": { "$value": "0.5rem", "$type": "dimension" },
|
|
73
|
+
"lg": { "$value": "0.75rem","$type": "dimension" },
|
|
74
|
+
"xl": { "$value": "1rem", "$type": "dimension" },
|
|
75
|
+
"full": { "$value": "9999px", "$type": "dimension" }
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
"fontSize": {
|
|
79
|
+
"xs": { "$value": "12px", "$type": "dimension" },
|
|
80
|
+
"sm": { "$value": "14px", "$type": "dimension" },
|
|
81
|
+
"base":{ "$value": "16px", "$type": "dimension" },
|
|
82
|
+
"lg": { "$value": "18px", "$type": "dimension" },
|
|
83
|
+
"xl": { "$value": "20px", "$type": "dimension" },
|
|
84
|
+
"2xl": { "$value": "24px", "$type": "dimension" },
|
|
85
|
+
"3xl": { "$value": "30px", "$type": "dimension" },
|
|
86
|
+
"4xl": { "$value": "36px", "$type": "dimension" }
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
"fontWeight": {
|
|
90
|
+
"regular": { "$value": 400, "$type": "fontWeight" },
|
|
91
|
+
"medium": { "$value": 500, "$type": "fontWeight" },
|
|
92
|
+
"semibold": { "$value": 600, "$type": "fontWeight" },
|
|
93
|
+
"bold": { "$value": 700, "$type": "fontWeight" }
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
"shadow": {
|
|
97
|
+
"sm": { "$value": "0 1px 2px rgba(0, 0, 0, 0.08)", "$type": "shadow" },
|
|
98
|
+
"md": { "$value": "0 4px 12px rgba(0, 0, 0, 0.12)", "$type": "shadow" },
|
|
99
|
+
"lg": { "$value": "0 8px 24px rgba(0, 0, 0, 0.15)", "$type": "shadow" },
|
|
100
|
+
"xl": { "$value": "0 16px 48px rgba(0, 0, 0, 0.18)", "$type": "shadow" }
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
"duration": {
|
|
104
|
+
"fast": { "$value": "120ms", "$type": "duration" },
|
|
105
|
+
"base": { "$value": "160ms", "$type": "duration" },
|
|
106
|
+
"slow": { "$value": "200ms", "$type": "duration" }
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
"easing": {
|
|
110
|
+
"standard": { "$value": "cubic-bezier(0.4, 0, 0.2, 1)", "$type": "easing" },
|
|
111
|
+
"emphasized": { "$value": "cubic-bezier(0.2, 0, 0, 1)", "$type": "easing" }
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
"controlHeight": {
|
|
115
|
+
"sm": { "$value": "32px", "$type": "dimension" },
|
|
116
|
+
"md": { "$value": "40px", "$type": "dimension" },
|
|
117
|
+
"lg": { "$value": "48px", "$type": "dimension" }
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
"borderWidth": {
|
|
121
|
+
"default": { "$value": "1px", "$type": "dimension" },
|
|
122
|
+
"strong": { "$value": "2px", "$type": "dimension" }
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
"opacity": {
|
|
126
|
+
"disabled": { "$value": 0.5, "$type": "number" }
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
"zIndex": {
|
|
130
|
+
"base": { "$value": 0, "$type": "number" },
|
|
131
|
+
"sticky": { "$value": 100, "$type": "number" },
|
|
132
|
+
"dropdown": { "$value": 200, "$type": "number" },
|
|
133
|
+
"overlay": { "$value": 300, "$type": "number" },
|
|
134
|
+
"modal": { "$value": 400, "$type": "number" },
|
|
135
|
+
"popover": { "$value": 500, "$type": "number" },
|
|
136
|
+
"toast": { "$value": 600, "$type": "number" },
|
|
137
|
+
"tooltip": { "$value": 700, "$type": "number" }
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
"breakpoint": {
|
|
141
|
+
"sm": { "$value": "640px", "$type": "dimension" },
|
|
142
|
+
"md": { "$value": "768px", "$type": "dimension" },
|
|
143
|
+
"lg": { "$value": "1024px", "$type": "dimension" },
|
|
144
|
+
"xl": { "$value": "1280px", "$type": "dimension" }
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "의미 토큰 — primitive 참조. 컴포넌트는 오직 이 계층만 사용한다. {base}, {primary} 등은 sh-ui.config.json의 theme 설정으로 치환된다.",
|
|
3
|
+
|
|
4
|
+
"light": {
|
|
5
|
+
"background": {
|
|
6
|
+
"default": { "$value": "{color.white}", "$type": "color" },
|
|
7
|
+
"subtle": { "$value": "{color.{base}.50}", "$type": "color" },
|
|
8
|
+
"muted": { "$value": "{color.{base}.100}", "$type": "color" },
|
|
9
|
+
"inverse": { "$value": "{color.{base}.950}", "$type": "color" }
|
|
10
|
+
},
|
|
11
|
+
"foreground": {
|
|
12
|
+
"default": { "$value": "{color.{base}.950}", "$type": "color" },
|
|
13
|
+
"muted": { "$value": "{color.{base}.600}", "$type": "color" },
|
|
14
|
+
"subtle": { "$value": "{color.{base}.400}", "$type": "color" },
|
|
15
|
+
"inverse": { "$value": "{color.white}", "$type": "color" }
|
|
16
|
+
},
|
|
17
|
+
"border": {
|
|
18
|
+
"default": { "$value": "{color.{base}.200}", "$type": "color" },
|
|
19
|
+
"strong": { "$value": "{color.{base}.300}", "$type": "color" }
|
|
20
|
+
},
|
|
21
|
+
"primary": {
|
|
22
|
+
"default": { "$value": "{color.{base}.900}", "$type": "color" },
|
|
23
|
+
"foreground": { "$value": "{color.{base}.50}", "$type": "color" },
|
|
24
|
+
"hover": { "$value": "{color.{base}.800}", "$type": "color" }
|
|
25
|
+
},
|
|
26
|
+
"danger": {
|
|
27
|
+
"default": { "$value": "{color.red.600}", "$type": "color" },
|
|
28
|
+
"foreground": { "$value": "{color.white}", "$type": "color" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
"dark": {
|
|
33
|
+
"background": {
|
|
34
|
+
"default": { "$value": "{color.{base}.950}", "$type": "color" },
|
|
35
|
+
"subtle": { "$value": "{color.{base}.900}", "$type": "color" },
|
|
36
|
+
"muted": { "$value": "{color.{base}.800}", "$type": "color" },
|
|
37
|
+
"inverse": { "$value": "{color.white}", "$type": "color" }
|
|
38
|
+
},
|
|
39
|
+
"foreground": {
|
|
40
|
+
"default": { "$value": "{color.{base}.50}", "$type": "color" },
|
|
41
|
+
"muted": { "$value": "{color.{base}.400}", "$type": "color" },
|
|
42
|
+
"subtle": { "$value": "{color.{base}.500}", "$type": "color" },
|
|
43
|
+
"inverse": { "$value": "{color.{base}.950}", "$type": "color" }
|
|
44
|
+
},
|
|
45
|
+
"border": {
|
|
46
|
+
"default": { "$value": "{color.{base}.800}", "$type": "color" },
|
|
47
|
+
"strong": { "$value": "{color.{base}.700}", "$type": "color" }
|
|
48
|
+
},
|
|
49
|
+
"primary": {
|
|
50
|
+
"default": { "$value": "{color.{base}.50}", "$type": "color" },
|
|
51
|
+
"foreground": { "$value": "{color.{base}.900}", "$type": "color" },
|
|
52
|
+
"hover": { "$value": "{color.{base}.200}", "$type": "color" }
|
|
53
|
+
},
|
|
54
|
+
"danger": {
|
|
55
|
+
"default": { "$value": "{color.red.600}", "$type": "color" },
|
|
56
|
+
"foreground": { "$value": "{color.white}", "$type": "color" }
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
"radius": {
|
|
61
|
+
"default": { "$value": "{radius.{radius}}", "$type": "dimension" }
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
"space": {
|
|
65
|
+
"0": { "$value": "{spacing.0}", "$type": "dimension" },
|
|
66
|
+
"1": { "$value": "{spacing.1}", "$type": "dimension" },
|
|
67
|
+
"2": { "$value": "{spacing.2}", "$type": "dimension" },
|
|
68
|
+
"3": { "$value": "{spacing.3}", "$type": "dimension" },
|
|
69
|
+
"4": { "$value": "{spacing.4}", "$type": "dimension" },
|
|
70
|
+
"5": { "$value": "{spacing.5}", "$type": "dimension" },
|
|
71
|
+
"6": { "$value": "{spacing.6}", "$type": "dimension" },
|
|
72
|
+
"8": { "$value": "{spacing.8}", "$type": "dimension" },
|
|
73
|
+
"10": { "$value": "{spacing.10}", "$type": "dimension" },
|
|
74
|
+
"12": { "$value": "{spacing.12}", "$type": "dimension" },
|
|
75
|
+
"16": { "$value": "{spacing.16}", "$type": "dimension" }
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
"text": {
|
|
79
|
+
"xs": { "$value": "{fontSize.xs}", "$type": "dimension" },
|
|
80
|
+
"sm": { "$value": "{fontSize.sm}", "$type": "dimension" },
|
|
81
|
+
"base":{ "$value": "{fontSize.base}", "$type": "dimension" },
|
|
82
|
+
"lg": { "$value": "{fontSize.lg}", "$type": "dimension" },
|
|
83
|
+
"xl": { "$value": "{fontSize.xl}", "$type": "dimension" },
|
|
84
|
+
"2xl": { "$value": "{fontSize.2xl}", "$type": "dimension" },
|
|
85
|
+
"3xl": { "$value": "{fontSize.3xl}", "$type": "dimension" },
|
|
86
|
+
"4xl": { "$value": "{fontSize.4xl}", "$type": "dimension" }
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
"weight": {
|
|
90
|
+
"regular": { "$value": "{fontWeight.regular}", "$type": "fontWeight" },
|
|
91
|
+
"medium": { "$value": "{fontWeight.medium}", "$type": "fontWeight" },
|
|
92
|
+
"semibold": { "$value": "{fontWeight.semibold}", "$type": "fontWeight" },
|
|
93
|
+
"bold": { "$value": "{fontWeight.bold}", "$type": "fontWeight" }
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
"shadow": {
|
|
97
|
+
"sm": { "$value": "{shadow.sm}", "$type": "shadow" },
|
|
98
|
+
"md": { "$value": "{shadow.md}", "$type": "shadow" },
|
|
99
|
+
"lg": { "$value": "{shadow.lg}", "$type": "shadow" },
|
|
100
|
+
"xl": { "$value": "{shadow.xl}", "$type": "shadow" }
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
"duration": {
|
|
104
|
+
"fast": { "$value": "{duration.fast}", "$type": "duration" },
|
|
105
|
+
"base": { "$value": "{duration.base}", "$type": "duration" },
|
|
106
|
+
"slow": { "$value": "{duration.slow}", "$type": "duration" }
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
"ease": {
|
|
110
|
+
"standard": { "$value": "{easing.standard}", "$type": "easing" },
|
|
111
|
+
"emphasized": { "$value": "{easing.emphasized}", "$type": "easing" }
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
"control": {
|
|
115
|
+
"sm": { "$value": "{controlHeight.sm}", "$type": "dimension" },
|
|
116
|
+
"md": { "$value": "{controlHeight.md}", "$type": "dimension" },
|
|
117
|
+
"lg": { "$value": "{controlHeight.lg}", "$type": "dimension" }
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
"border-width": {
|
|
121
|
+
"default": { "$value": "{borderWidth.default}", "$type": "dimension" },
|
|
122
|
+
"strong": { "$value": "{borderWidth.strong}", "$type": "dimension" }
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
"opacity": {
|
|
126
|
+
"disabled": { "$value": "{opacity.disabled}", "$type": "number" }
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
"z": {
|
|
130
|
+
"base": { "$value": "{zIndex.base}", "$type": "number" },
|
|
131
|
+
"sticky": { "$value": "{zIndex.sticky}", "$type": "number" },
|
|
132
|
+
"dropdown": { "$value": "{zIndex.dropdown}", "$type": "number" },
|
|
133
|
+
"overlay": { "$value": "{zIndex.overlay}", "$type": "number" },
|
|
134
|
+
"modal": { "$value": "{zIndex.modal}", "$type": "number" },
|
|
135
|
+
"popover": { "$value": "{zIndex.popover}", "$type": "number" },
|
|
136
|
+
"toast": { "$value": "{zIndex.toast}", "$type": "number" },
|
|
137
|
+
"tooltip": { "$value": "{zIndex.tooltip}", "$type": "number" }
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
"bp": {
|
|
141
|
+
"sm": { "$value": "{breakpoint.sm}", "$type": "dimension" },
|
|
142
|
+
"md": { "$value": "{breakpoint.md}", "$type": "dimension" },
|
|
143
|
+
"lg": { "$value": "{breakpoint.lg}", "$type": "dimension" },
|
|
144
|
+
"xl": { "$value": "{breakpoint.xl}", "$type": "dimension" }
|
|
145
|
+
}
|
|
146
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sh-ui-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "sh-ui CLI — 디자인 시스템 컴포넌트를 프로젝트로 복사하는 CLI (sh-ui init / add / list / remove)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -15,10 +15,15 @@
|
|
|
15
15
|
"keywords": [
|
|
16
16
|
"sh-ui",
|
|
17
17
|
"cli",
|
|
18
|
+
"mcp",
|
|
18
19
|
"design-system",
|
|
19
20
|
"registry",
|
|
20
21
|
"components"
|
|
21
22
|
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
25
|
+
"zod": "^3.25.0"
|
|
26
|
+
},
|
|
22
27
|
"publishConfig": {
|
|
23
28
|
"access": "public"
|
|
24
29
|
},
|
|
@@ -26,11 +31,15 @@
|
|
|
26
31
|
"bin": {
|
|
27
32
|
"sh-ui": "./bin/sh-ui.mjs"
|
|
28
33
|
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"bundle-data": "node scripts/copy-data.mjs",
|
|
36
|
+
"prepublishOnly": "node scripts/copy-data.mjs && node --check bin/sh-ui.mjs"
|
|
37
|
+
},
|
|
29
38
|
"files": [
|
|
30
39
|
"bin",
|
|
31
40
|
"src",
|
|
41
|
+
"data",
|
|
32
42
|
"LICENSE",
|
|
33
43
|
"README.md"
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
}
|
|
44
|
+
]
|
|
45
|
+
}
|
package/src/add.mjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { readFile, writeFile, mkdir
|
|
1
|
+
import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { dirname, resolve, relative } from "node:path";
|
|
4
|
-
import {
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
|
-
import { buildTokensCss, buildTokensDart } from "../../tokens/build.mjs";
|
|
7
6
|
import { formatUnifiedDiff } from "./diff.mjs";
|
|
7
|
+
import { getRegistryRoot, getTokensRoot } from "./paths.mjs";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// tokens/build.mjs 는 모노레포·출고 모드에 따라 위치가 달라서 동적 import.
|
|
10
|
+
async function loadTokensBuilder() {
|
|
11
|
+
const url = pathToFileURL(resolve(getTokensRoot(), "build.mjs")).href;
|
|
12
|
+
return import(url);
|
|
13
|
+
}
|
|
11
14
|
|
|
12
15
|
/** 컬러 출력 가능 여부: TTY + NO_COLOR 미설정. */
|
|
13
16
|
function canUseColor() {
|
|
@@ -81,6 +84,7 @@ async function addTokens(config, cwd, diffMode, summary) {
|
|
|
81
84
|
if (!destRel) throw new Error("paths.tokens 가 설정에 없습니다.");
|
|
82
85
|
const dest = resolve(cwd, destRel);
|
|
83
86
|
|
|
87
|
+
const { buildTokensCss, buildTokensDart } = await loadTokensBuilder();
|
|
84
88
|
const content =
|
|
85
89
|
config.platform === "react"
|
|
86
90
|
? await buildTokensCss(config)
|
|
@@ -93,13 +97,10 @@ async function addTokens(config, cwd, diffMode, summary) {
|
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
async function addComponent(name, config, cwd, installed, pendingDeps, diffMode, summary) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
config.platform,
|
|
100
|
-
"registry.json",
|
|
100
|
+
const registryRoot = getRegistryRoot(config.platform);
|
|
101
|
+
const registry = JSON.parse(
|
|
102
|
+
await readFile(resolve(registryRoot, "registry.json"), "utf8"),
|
|
101
103
|
);
|
|
102
|
-
const registry = JSON.parse(await readFile(registryPath, "utf8"));
|
|
103
104
|
const entry = registry.components?.[name];
|
|
104
105
|
if (!entry) {
|
|
105
106
|
throw new Error(
|
|
@@ -112,7 +113,7 @@ async function addComponent(name, config, cwd, installed, pendingDeps, diffMode,
|
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
for (const file of entry.files) {
|
|
115
|
-
const src = resolve(
|
|
116
|
+
const src = resolve(registryRoot, file.src);
|
|
116
117
|
const dest = resolve(cwd, resolveDest(file.dest, config));
|
|
117
118
|
const content = await readFile(src, "utf8");
|
|
118
119
|
const result = await writeOrDiff({ dest, content, cwd, diffMode, summary });
|
package/src/list.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
const REPO_ROOT = resolve(__dirname, "../../..");
|
|
3
|
+
import { resolve, relative } from "node:path";
|
|
4
|
+
import { getRegistryRoot } from "./paths.mjs";
|
|
8
5
|
|
|
9
6
|
function resolveDest(template, config) {
|
|
10
7
|
return template.replace(/\{([a-zA-Z0-9_]+)\}/g, (m, key) => {
|
|
@@ -26,12 +23,7 @@ async function loadConfig(cwd) {
|
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
async function loadRegistry(platform) {
|
|
29
|
-
const registryPath = resolve(
|
|
30
|
-
REPO_ROOT,
|
|
31
|
-
"packages/registry",
|
|
32
|
-
platform,
|
|
33
|
-
"registry.json",
|
|
34
|
-
);
|
|
26
|
+
const registryPath = resolve(getRegistryRoot(platform), "registry.json");
|
|
35
27
|
return JSON.parse(await readFile(registryPath, "utf8"));
|
|
36
28
|
}
|
|
37
29
|
|