mcp-elements 0.1.0 → 0.1.2
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/LICENSE +21 -0
- package/dist/{chunk-ZEZGJIP2.js → chunk-WT4KIDWW.js} +95 -1
- package/dist/chunk-WT4KIDWW.js.map +1 -0
- package/dist/index.js +125 -38
- package/dist/index.js.map +1 -1
- package/dist/{resolve-UAWQZ45B.js → resolve-3LDLIADF.js} +2 -2
- package/package.json +10 -10
- package/dist/chunk-ZEZGJIP2.js.map +0 -1
- /package/dist/{resolve-UAWQZ45B.js.map → resolve-3LDLIADF.js.map} +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mayur Rawte
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -7,6 +7,100 @@ var registry_default = {
|
|
|
7
7
|
sharedCoreDeps: ["core/src/utils/cn.ts"]
|
|
8
8
|
},
|
|
9
9
|
components: {
|
|
10
|
+
"mcp-server-status": {
|
|
11
|
+
name: "mcp-server-status",
|
|
12
|
+
type: "css-only",
|
|
13
|
+
category: "mcp",
|
|
14
|
+
files: {
|
|
15
|
+
css: "css/components/mcp-server-status.css",
|
|
16
|
+
react: "react/src/mcp/mcp-server-status.tsx",
|
|
17
|
+
angular: "angular/src/mcp/mcp-server-status.component.ts",
|
|
18
|
+
vue: "vue/src/mcp/mcp-server-status.ts"
|
|
19
|
+
},
|
|
20
|
+
dependencies: { internal: [], npm: {} }
|
|
21
|
+
},
|
|
22
|
+
"mcp-tool-call": {
|
|
23
|
+
name: "mcp-tool-call",
|
|
24
|
+
type: "interactive",
|
|
25
|
+
category: "mcp",
|
|
26
|
+
files: {
|
|
27
|
+
css: "css/components/mcp-tool-call.css",
|
|
28
|
+
core: "core/src/mcp/tool-state.ts",
|
|
29
|
+
react: "react/src/mcp/mcp-tool-call.tsx",
|
|
30
|
+
angular: "angular/src/mcp/mcp-tool-call.component.ts",
|
|
31
|
+
vue: "vue/src/mcp/mcp-tool-call.ts"
|
|
32
|
+
},
|
|
33
|
+
coreDeps: ["core/src/mcp/types.ts"],
|
|
34
|
+
dependencies: { internal: [], npm: {} }
|
|
35
|
+
},
|
|
36
|
+
"mcp-tool-form": {
|
|
37
|
+
name: "mcp-tool-form",
|
|
38
|
+
type: "interactive",
|
|
39
|
+
category: "mcp",
|
|
40
|
+
files: {
|
|
41
|
+
css: "css/components/mcp-tool-form.css",
|
|
42
|
+
core: "core/src/mcp/schema-form.ts",
|
|
43
|
+
react: "react/src/mcp/mcp-tool-form.tsx",
|
|
44
|
+
angular: "angular/src/mcp/mcp-tool-form.component.ts",
|
|
45
|
+
vue: "vue/src/mcp/mcp-tool-form.ts"
|
|
46
|
+
},
|
|
47
|
+
coreDeps: ["core/src/mcp/types.ts"],
|
|
48
|
+
dependencies: { internal: [], npm: {} }
|
|
49
|
+
},
|
|
50
|
+
"mcp-consent-dialog": {
|
|
51
|
+
name: "mcp-consent-dialog",
|
|
52
|
+
type: "interactive",
|
|
53
|
+
category: "mcp",
|
|
54
|
+
files: {
|
|
55
|
+
css: "css/components/mcp-consent-dialog.css",
|
|
56
|
+
core: "core/src/mcp/scope.ts",
|
|
57
|
+
react: "react/src/mcp/mcp-consent-dialog.tsx",
|
|
58
|
+
angular: "angular/src/mcp/mcp-consent-dialog.component.ts",
|
|
59
|
+
vue: "vue/src/mcp/mcp-consent-dialog.ts"
|
|
60
|
+
},
|
|
61
|
+
coreDeps: ["core/src/mcp/types.ts"],
|
|
62
|
+
dependencies: { internal: ["dialog", "button"], npm: {} }
|
|
63
|
+
},
|
|
64
|
+
"mcp-scope-inspector": {
|
|
65
|
+
name: "mcp-scope-inspector",
|
|
66
|
+
type: "interactive",
|
|
67
|
+
category: "mcp",
|
|
68
|
+
files: {
|
|
69
|
+
css: "css/components/mcp-scope-inspector.css",
|
|
70
|
+
core: "core/src/mcp/scope.ts",
|
|
71
|
+
react: "react/src/mcp/mcp-scope-inspector.tsx",
|
|
72
|
+
angular: "angular/src/mcp/mcp-scope-inspector.component.ts",
|
|
73
|
+
vue: "vue/src/mcp/mcp-scope-inspector.ts"
|
|
74
|
+
},
|
|
75
|
+
coreDeps: ["core/src/mcp/types.ts"],
|
|
76
|
+
dependencies: { internal: [], npm: {} }
|
|
77
|
+
},
|
|
78
|
+
"mcp-resource-browser": {
|
|
79
|
+
name: "mcp-resource-browser",
|
|
80
|
+
type: "css-only",
|
|
81
|
+
category: "mcp",
|
|
82
|
+
files: {
|
|
83
|
+
css: "css/components/mcp-resource-browser.css",
|
|
84
|
+
react: "react/src/mcp/mcp-resource-browser.tsx",
|
|
85
|
+
angular: "angular/src/mcp/mcp-resource-browser.component.ts",
|
|
86
|
+
vue: "vue/src/mcp/mcp-resource-browser.ts"
|
|
87
|
+
},
|
|
88
|
+
dependencies: { internal: ["skeleton"], npm: {} }
|
|
89
|
+
},
|
|
90
|
+
"mcp-app-frame": {
|
|
91
|
+
name: "mcp-app-frame",
|
|
92
|
+
type: "interactive",
|
|
93
|
+
category: "mcp",
|
|
94
|
+
files: {
|
|
95
|
+
css: "css/components/mcp-app-frame.css",
|
|
96
|
+
core: "core/src/mcp/app-bridge.ts",
|
|
97
|
+
react: "react/src/mcp/mcp-app-frame.tsx",
|
|
98
|
+
angular: "angular/src/mcp/mcp-app-frame.component.ts",
|
|
99
|
+
vue: "vue/src/mcp/mcp-app-frame.ts"
|
|
100
|
+
},
|
|
101
|
+
coreDeps: [],
|
|
102
|
+
dependencies: { internal: [], npm: {} }
|
|
103
|
+
},
|
|
10
104
|
button: {
|
|
11
105
|
name: "button",
|
|
12
106
|
type: "css-only",
|
|
@@ -378,4 +472,4 @@ export {
|
|
|
378
472
|
getComponent,
|
|
379
473
|
listComponents
|
|
380
474
|
};
|
|
381
|
-
//# sourceMappingURL=chunk-
|
|
475
|
+
//# sourceMappingURL=chunk-WT4KIDWW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/registry/registry.json","../src/registry/resolve.ts"],"sourcesContent":["{\n \"meta\": {\n \"baseUrl\": \"https://raw.githubusercontent.com/mcp-elements/ui/main/packages\",\n \"sharedCoreDeps\": [\"core/src/utils/cn.ts\"]\n },\n \"components\": {\n \"mcp-server-status\": {\n \"name\": \"mcp-server-status\",\n \"type\": \"css-only\",\n \"category\": \"mcp\",\n \"files\": {\n \"css\": \"css/components/mcp-server-status.css\",\n \"react\": \"react/src/mcp/mcp-server-status.tsx\",\n \"angular\": \"angular/src/mcp/mcp-server-status.component.ts\",\n \"vue\": \"vue/src/mcp/mcp-server-status.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"mcp-tool-call\": {\n \"name\": \"mcp-tool-call\",\n \"type\": \"interactive\",\n \"category\": \"mcp\",\n \"files\": {\n \"css\": \"css/components/mcp-tool-call.css\",\n \"core\": \"core/src/mcp/tool-state.ts\",\n \"react\": \"react/src/mcp/mcp-tool-call.tsx\",\n \"angular\": \"angular/src/mcp/mcp-tool-call.component.ts\",\n \"vue\": \"vue/src/mcp/mcp-tool-call.ts\"\n },\n \"coreDeps\": [\"core/src/mcp/types.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"mcp-tool-form\": {\n \"name\": \"mcp-tool-form\",\n \"type\": \"interactive\",\n \"category\": \"mcp\",\n \"files\": {\n \"css\": \"css/components/mcp-tool-form.css\",\n \"core\": \"core/src/mcp/schema-form.ts\",\n \"react\": \"react/src/mcp/mcp-tool-form.tsx\",\n \"angular\": \"angular/src/mcp/mcp-tool-form.component.ts\",\n \"vue\": \"vue/src/mcp/mcp-tool-form.ts\"\n },\n \"coreDeps\": [\"core/src/mcp/types.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"mcp-consent-dialog\": {\n \"name\": \"mcp-consent-dialog\",\n \"type\": \"interactive\",\n \"category\": \"mcp\",\n \"files\": {\n \"css\": \"css/components/mcp-consent-dialog.css\",\n \"core\": \"core/src/mcp/scope.ts\",\n \"react\": \"react/src/mcp/mcp-consent-dialog.tsx\",\n \"angular\": \"angular/src/mcp/mcp-consent-dialog.component.ts\",\n \"vue\": \"vue/src/mcp/mcp-consent-dialog.ts\"\n },\n \"coreDeps\": [\"core/src/mcp/types.ts\"],\n \"dependencies\": { \"internal\": [\"dialog\", \"button\"], \"npm\": {} }\n },\n \"mcp-scope-inspector\": {\n \"name\": \"mcp-scope-inspector\",\n \"type\": \"interactive\",\n \"category\": \"mcp\",\n \"files\": {\n \"css\": \"css/components/mcp-scope-inspector.css\",\n \"core\": \"core/src/mcp/scope.ts\",\n \"react\": \"react/src/mcp/mcp-scope-inspector.tsx\",\n \"angular\": \"angular/src/mcp/mcp-scope-inspector.component.ts\",\n \"vue\": \"vue/src/mcp/mcp-scope-inspector.ts\"\n },\n \"coreDeps\": [\"core/src/mcp/types.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"mcp-resource-browser\": {\n \"name\": \"mcp-resource-browser\",\n \"type\": \"css-only\",\n \"category\": \"mcp\",\n \"files\": {\n \"css\": \"css/components/mcp-resource-browser.css\",\n \"react\": \"react/src/mcp/mcp-resource-browser.tsx\",\n \"angular\": \"angular/src/mcp/mcp-resource-browser.component.ts\",\n \"vue\": \"vue/src/mcp/mcp-resource-browser.ts\"\n },\n \"dependencies\": { \"internal\": [\"skeleton\"], \"npm\": {} }\n },\n \"mcp-app-frame\": {\n \"name\": \"mcp-app-frame\",\n \"type\": \"interactive\",\n \"category\": \"mcp\",\n \"files\": {\n \"css\": \"css/components/mcp-app-frame.css\",\n \"core\": \"core/src/mcp/app-bridge.ts\",\n \"react\": \"react/src/mcp/mcp-app-frame.tsx\",\n \"angular\": \"angular/src/mcp/mcp-app-frame.component.ts\",\n \"vue\": \"vue/src/mcp/mcp-app-frame.ts\"\n },\n \"coreDeps\": [],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"button\": {\n \"name\": \"button\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/button.css\",\n \"react\": \"react/src/button.tsx\",\n \"angular\": \"angular/src/button.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"badge\": {\n \"name\": \"badge\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/badge.css\",\n \"react\": \"react/src/badge.tsx\",\n \"angular\": \"angular/src/badge.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"card\": {\n \"name\": \"card\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/card.css\",\n \"react\": \"react/src/card.tsx\",\n \"angular\": \"angular/src/card.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"input\": {\n \"name\": \"input\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/input.css\",\n \"react\": \"react/src/input.tsx\",\n \"angular\": \"angular/src/input.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"textarea\": {\n \"name\": \"textarea\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/textarea.css\",\n \"react\": \"react/src/textarea.tsx\",\n \"angular\": \"angular/src/textarea.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"avatar\": {\n \"name\": \"avatar\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/avatar.css\",\n \"react\": \"react/src/avatar.tsx\",\n \"angular\": \"angular/src/avatar.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"separator\": {\n \"name\": \"separator\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/separator.css\",\n \"react\": \"react/src/separator.tsx\",\n \"angular\": \"angular/src/separator.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"skeleton\": {\n \"name\": \"skeleton\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/skeleton.css\",\n \"react\": \"react/src/skeleton.tsx\",\n \"angular\": \"angular/src/skeleton.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"dialog\": {\n \"name\": \"dialog\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/dialog.css\",\n \"core\": \"core/src/dialog.ts\",\n \"react\": [\"react/src/dialog.tsx\", \"react/src/hooks/use-dialog.ts\"],\n \"angular\": \"angular/src/dialog.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\"],\n \"dependencies\": { \"internal\": [\"button\"], \"npm\": {} }\n },\n \"tabs\": {\n \"name\": \"tabs\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/tabs.css\",\n \"core\": \"core/src/tabs.ts\",\n \"react\": [\"react/src/tabs.tsx\", \"react/src/hooks/use-tabs.ts\"],\n \"angular\": \"angular/src/tabs.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/keyboard.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"accordion\": {\n \"name\": \"accordion\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/accordion.css\",\n \"core\": \"core/src/accordion.ts\",\n \"react\": [\"react/src/accordion.tsx\", \"react/src/hooks/use-accordion.ts\"],\n \"angular\": \"angular/src/accordion.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/keyboard.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"select\": {\n \"name\": \"select\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/select.css\",\n \"core\": \"core/src/select.ts\",\n \"react\": [\"react/src/select.tsx\", \"react/src/hooks/use-select.ts\"],\n \"angular\": \"angular/src/select.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\", \"core/src/utils/keyboard.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"tooltip\": {\n \"name\": \"tooltip\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/tooltip.css\",\n \"core\": \"core/src/tooltip.ts\",\n \"react\": [\"react/src/tooltip.tsx\", \"react/src/hooks/use-tooltip.ts\"],\n \"angular\": \"angular/src/tooltip.directive.ts\"\n },\n \"coreDeps\": [],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"popover\": {\n \"name\": \"popover\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/popover.css\",\n \"core\": \"core/src/popover.ts\",\n \"react\": [\"react/src/popover.tsx\", \"react/src/hooks/use-popover.ts\"],\n \"angular\": \"angular/src/popover.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"toast\": {\n \"name\": \"toast\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/toast.css\",\n \"core\": \"core/src/toast.ts\",\n \"react\": [\"react/src/toast.tsx\", \"react/src/hooks/use-toast.ts\"],\n \"angular\": \"angular/src/toast.component.ts\"\n },\n \"coreDeps\": [],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"drawer\": {\n \"name\": \"drawer\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/drawer.css\",\n \"core\": \"core/src/drawer.ts\",\n \"react\": [\"react/src/drawer.tsx\", \"react/src/hooks/use-drawer.ts\"],\n \"angular\": \"angular/src/drawer.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"dropdown-menu\": {\n \"name\": \"dropdown-menu\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/dropdown-menu.css\",\n \"core\": \"core/src/dropdown-menu.ts\",\n \"react\": [\"react/src/dropdown-menu.tsx\", \"react/src/hooks/use-dropdown-menu.ts\"],\n \"angular\": \"angular/src/dropdown-menu.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\", \"core/src/utils/keyboard.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"switch\": {\n \"name\": \"switch\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/switch.css\",\n \"core\": \"core/src/switch.ts\",\n \"react\": \"react/src/switch.tsx\",\n \"angular\": \"angular/src/switch.component.ts\"\n },\n \"coreDeps\": [],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"progress\": {\n \"name\": \"progress\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/progress.css\",\n \"react\": \"react/src/progress.tsx\",\n \"angular\": \"angular/src/progress.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"loader\": {\n \"name\": \"loader\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/loader.css\",\n \"react\": \"react/src/loader.tsx\",\n \"angular\": \"angular/src/loader.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"chips\": {\n \"name\": \"chips\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/chips.css\",\n \"react\": \"react/src/chips.tsx\",\n \"angular\": \"angular/src/chips.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"password-input\": {\n \"name\": \"password-input\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/password-input.css\",\n \"react\": \"react/src/password-input.tsx\",\n \"angular\": \"angular/src/password-input.component.ts\"\n },\n \"dependencies\": { \"internal\": [\"input\"], \"npm\": {} }\n },\n \"counter\": {\n \"name\": \"counter\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/counter.css\",\n \"react\": \"react/src/counter.tsx\",\n \"angular\": \"angular/src/counter.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"alert\": {\n \"name\": \"alert\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/alert.css\",\n \"react\": \"react/src/alert.tsx\",\n \"angular\": \"angular/src/alert.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"prompt-input\": {\n \"name\": \"prompt-input\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/prompt-input.css\",\n \"react\": \"react/src/prompt-input.tsx\",\n \"angular\": \"angular/src/prompt-input.component.ts\"\n },\n \"dependencies\": { \"internal\": [\"button\"], \"npm\": {} }\n },\n \"chat-bubble\": {\n \"name\": \"chat-bubble\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/chat-bubble.css\",\n \"react\": \"react/src/chat-bubble.tsx\",\n \"angular\": \"angular/src/chat-bubble.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"ai-badge\": {\n \"name\": \"ai-badge\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/ai-badge.css\",\n \"react\": \"react/src/ai-badge.tsx\",\n \"angular\": \"angular/src/ai-badge.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"suggestion-chips\": {\n \"name\": \"suggestion-chips\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/suggestion-chips.css\",\n \"react\": \"react/src/suggestion-chips.tsx\",\n \"angular\": \"angular/src/suggestion-chips.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"source-card\": {\n \"name\": \"source-card\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/source-card.css\",\n \"react\": \"react/src/source-card.tsx\",\n \"angular\": \"angular/src/source-card.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"streaming-text\": {\n \"name\": \"streaming-text\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/streaming-text.css\",\n \"react\": \"react/src/streaming-text.tsx\",\n \"angular\": \"angular/src/streaming-text.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"feedback\": {\n \"name\": \"feedback\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/feedback.css\",\n \"react\": \"react/src/feedback.tsx\",\n \"angular\": \"angular/src/feedback.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n }\n }\n}\n","import registryData from './registry.json' with { type: 'json' }\n\nexport interface ComponentEntry {\n name: string\n type: 'css-only' | 'interactive'\n category?: string\n tags?: string[]\n files: {\n css?: string\n core?: string\n react?: string | string[]\n angular?: string | string[]\n vue?: string | string[]\n }\n coreDeps?: string[]\n dependencies: {\n internal: string[]\n npm: Record<string, string[]>\n }\n}\n\nexport interface RegistryMeta {\n baseUrl: string\n sharedCoreDeps: string[]\n}\n\nexport interface Registry {\n meta: RegistryMeta\n components: Record<string, ComponentEntry>\n}\n\nexport const registry = registryData as unknown as Registry\n\nexport function resolveComponentDeps(name: string, resolved = new Set<string>()): string[] {\n const component = registry.components[name]\n if (!component) return []\n\n for (const dep of component.dependencies.internal) {\n if (!resolved.has(dep)) {\n resolved.add(dep)\n resolveComponentDeps(dep, resolved)\n }\n }\n\n return Array.from(resolved)\n}\n\nexport function resolveCoreDeps(name: string): string[] {\n const component = registry.components[name]\n if (!component) return []\n\n const deps = new Set<string>(registry.meta.sharedCoreDeps)\n\n if (component.coreDeps) {\n for (const dep of component.coreDeps) {\n deps.add(dep)\n }\n }\n\n return Array.from(deps)\n}\n\nexport function getComponent(name: string): ComponentEntry | undefined {\n return registry.components[name]\n}\n\nexport function listComponents(): string[] {\n return Object.keys(registry.components)\n}\n"],"mappings":";;;AAAA;AAAA,EACE,MAAQ;AAAA,IACN,SAAW;AAAA,IACX,gBAAkB,CAAC,sBAAsB;AAAA,EAC3C;AAAA,EACA,YAAc;AAAA,IACZ,qBAAqB;AAAA,MACnB,MAAQ;AAAA,MACR,MAAQ;AAAA,MACR,UAAY;AAAA,MACZ,OAAS;AAAA,QACP,KAAO;AAAA,QACP,OAAS;AAAA,QACT,SAAW;AAAA,QACX,KAAO;AAAA,MACT;AAAA,MACA,cAAgB,EAAE,UAAY,CAAC,GAAG,KAAO,CAAC,EAAE;AAAA,IAC9C;AAAA,IACA,iBAAiB;AAAA,MACf,MAAQ;AAAA,MACR,MAAQ;AAAA,MACR,UAAY;AAAA,MACZ,OAAS;AAAA,QACP,KAAO;AAAA,QACP,MAAQ;AAAA,QACR,OAAS;AAAA,QACT,SAAW;AAAA,QACX,KAAO;AAAA,MACT;AAAA,MACA,UAAY,CAAC,uBAAuB;AAAA,MACpC,cAAgB,EAAE,UAAY,CAAC,GAAG,KAAO,CAAC,EAAE;AAAA,IAC9C;AAAA,IACA,iBAAiB;AAAA,MACf,MAAQ;AAAA,MACR,MAAQ;AAAA,MACR,UAAY;AAAA,MACZ,OA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ACjD,QAAI,CAAC,SAAS,IAAI,GAAG,GAAG;AACtB,eAAS,IAAI,GAAG;AAChB,2BAAqB,KAAK,QAAQ;AAAA,IACpC;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,QAAQ;AAC5B;AAEO,SAAS,gBAAgB,MAAwB;AACtD,QAAM,YAAY,SAAS,WAAW,IAAI;AAC1C,MAAI,CAAC,UAAW,QAAO,CAAC;AAExB,QAAM,OAAO,IAAI,IAAY,SAAS,KAAK,cAAc;AAEzD,MAAI,UAAU,UAAU;AACtB,eAAW,OAAO,UAAU,UAAU;AACpC,WAAK,IAAI,GAAG;AAAA,IACd;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;AAEO,SAAS,aAAa,MAA0C;AACrE,SAAO,SAAS,WAAW,IAAI;AACjC;AAEO,SAAS,iBAA2B;AACzC,SAAO,OAAO,KAAK,SAAS,UAAU;AACxC;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
registry,
|
|
4
4
|
resolveComponentDeps,
|
|
5
5
|
resolveCoreDeps
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WT4KIDWW.js";
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
import { Command as Command4 } from "commander";
|
|
@@ -27,6 +27,7 @@ function detectFramework(cwd) {
|
|
|
27
27
|
};
|
|
28
28
|
if (allDeps["@angular/core"]) return "angular";
|
|
29
29
|
if (allDeps["react"]) return "react";
|
|
30
|
+
if (allDeps["vue"]) return "vue";
|
|
30
31
|
return null;
|
|
31
32
|
} catch {
|
|
32
33
|
return null;
|
|
@@ -87,7 +88,8 @@ var initCommand = new Command("init").description("Initialize mcp-elements in yo
|
|
|
87
88
|
message: "Which framework are you using?",
|
|
88
89
|
choices: [
|
|
89
90
|
{ title: "React", value: "react" },
|
|
90
|
-
{ title: "Angular", value: "angular" }
|
|
91
|
+
{ title: "Angular", value: "angular" },
|
|
92
|
+
{ title: "Vue", value: "vue" }
|
|
91
93
|
]
|
|
92
94
|
});
|
|
93
95
|
framework = response.framework;
|
|
@@ -98,7 +100,7 @@ var initCommand = new Command("init").description("Initialize mcp-elements in yo
|
|
|
98
100
|
console.log(pc.red(" No framework selected. Aborting."));
|
|
99
101
|
return;
|
|
100
102
|
}
|
|
101
|
-
const defaultComponentDir = framework === "
|
|
103
|
+
const defaultComponentDir = framework === "angular" ? "src/app/components/ui" : "src/components/ui";
|
|
102
104
|
const { componentDir, cssPath, typescript } = await prompts([
|
|
103
105
|
{
|
|
104
106
|
type: "text",
|
|
@@ -110,7 +112,7 @@ var initCommand = new Command("init").description("Initialize mcp-elements in yo
|
|
|
110
112
|
type: "text",
|
|
111
113
|
name: "cssPath",
|
|
112
114
|
message: "Where is your global CSS file?",
|
|
113
|
-
initial: framework === "react" ? "src/index.css" : "src/styles.css"
|
|
115
|
+
initial: framework === "react" ? "src/index.css" : framework === "vue" ? "src/style.css" : "src/styles.css"
|
|
114
116
|
},
|
|
115
117
|
{
|
|
116
118
|
type: "confirm",
|
|
@@ -120,7 +122,7 @@ var initCommand = new Command("init").description("Initialize mcp-elements in yo
|
|
|
120
122
|
}
|
|
121
123
|
]);
|
|
122
124
|
const config = {
|
|
123
|
-
$schema: "https://mcp-elements.
|
|
125
|
+
$schema: "https://mcp-elements.wearesnx.studio/schema.json",
|
|
124
126
|
framework,
|
|
125
127
|
typescript,
|
|
126
128
|
tailwind: {
|
|
@@ -129,7 +131,7 @@ var initCommand = new Command("init").description("Initialize mcp-elements in yo
|
|
|
129
131
|
},
|
|
130
132
|
aliases: {
|
|
131
133
|
components: componentDir,
|
|
132
|
-
utils: framework === "
|
|
134
|
+
utils: framework === "angular" ? "src/app/lib/utils" : "src/lib/utils"
|
|
133
135
|
}
|
|
134
136
|
};
|
|
135
137
|
await writeFile(
|
|
@@ -224,11 +226,12 @@ var initCommand = new Command("init").description("Initialize mcp-elements in yo
|
|
|
224
226
|
// src/commands/add.ts
|
|
225
227
|
import { Command as Command2 } from "commander";
|
|
226
228
|
import pc2 from "picocolors";
|
|
227
|
-
import
|
|
229
|
+
import path6 from "path";
|
|
228
230
|
import fs5 from "fs";
|
|
229
231
|
import prompts2 from "prompts";
|
|
230
232
|
|
|
231
233
|
// src/utils/transform.ts
|
|
234
|
+
import path4 from "path";
|
|
232
235
|
var SYMBOL_TO_FILE = {
|
|
233
236
|
// utils/cn.ts
|
|
234
237
|
cn: "cn",
|
|
@@ -278,12 +281,57 @@ var SYMBOL_TO_FILE = {
|
|
|
278
281
|
DropdownMenuItem: "dropdown-menu",
|
|
279
282
|
// switch
|
|
280
283
|
createSwitch: "switch",
|
|
281
|
-
SwitchConfig: "switch"
|
|
284
|
+
SwitchConfig: "switch",
|
|
285
|
+
// mcp/types.ts
|
|
286
|
+
BaseMetadata: "types",
|
|
287
|
+
Icons: "types",
|
|
288
|
+
Implementation: "types",
|
|
289
|
+
ServerCapabilities: "types",
|
|
290
|
+
JsonSchema: "types",
|
|
291
|
+
Tool: "types",
|
|
292
|
+
Resource: "types",
|
|
293
|
+
Prompt: "types",
|
|
294
|
+
ContentBlock: "types",
|
|
295
|
+
CallToolResult: "types",
|
|
296
|
+
UiResource: "types",
|
|
297
|
+
ToolCallStatus: "types",
|
|
298
|
+
ScopeDescriptor: "types",
|
|
299
|
+
// mcp/tool-state.ts
|
|
300
|
+
createToolState: "tool-state",
|
|
301
|
+
ToolStateSnapshot: "tool-state",
|
|
302
|
+
ToolStateApi: "tool-state",
|
|
303
|
+
// mcp/scope.ts
|
|
304
|
+
parseScope: "scope",
|
|
305
|
+
parseScopes: "scope",
|
|
306
|
+
// mcp/schema-form.ts
|
|
307
|
+
schemaToFields: "schema-form",
|
|
308
|
+
FieldKind: "schema-form",
|
|
309
|
+
FieldDescriptor: "schema-form",
|
|
310
|
+
// mcp/app-bridge.ts
|
|
311
|
+
createAppBridge: "app-bridge",
|
|
312
|
+
encodeEnvelope: "app-bridge",
|
|
313
|
+
decodeEnvelope: "app-bridge",
|
|
314
|
+
AppBridge: "app-bridge",
|
|
315
|
+
AppBridgeConfig: "app-bridge",
|
|
316
|
+
AppMessageEnvelope: "app-bridge",
|
|
317
|
+
// mcp/oauth.ts
|
|
318
|
+
createOAuthFlow: "oauth",
|
|
319
|
+
buildAuthUrl: "oauth",
|
|
320
|
+
buildTokenExchangeBody: "oauth",
|
|
321
|
+
buildTokenRefreshBody: "oauth",
|
|
322
|
+
OAuthFlowApi: "oauth",
|
|
323
|
+
OAuthFlowSnapshot: "oauth",
|
|
324
|
+
OAuthStatus: "oauth",
|
|
325
|
+
OAuthTokens: "oauth",
|
|
326
|
+
PkcePair: "oauth",
|
|
327
|
+
AuthUrlInput: "oauth",
|
|
328
|
+
TokenExchangeInput: "oauth",
|
|
329
|
+
TokenRefreshInput: "oauth"
|
|
282
330
|
};
|
|
283
331
|
var CORE_IMPORT_RE = /import\s+(type\s+)?{([^}]+)}\s+from\s+['"]@mcp-elements\/core['"]/g;
|
|
284
332
|
function transformImports(content, config) {
|
|
285
333
|
let result = content;
|
|
286
|
-
const utilsPath = config.aliases.utils;
|
|
334
|
+
const utilsPath = path4.posix.relative(config.aliases.components, config.aliases.utils) || ".";
|
|
287
335
|
result = result.replace(CORE_IMPORT_RE, (match, typeKeyword, symbolsStr) => {
|
|
288
336
|
const isTypeOnly = !!typeKeyword;
|
|
289
337
|
const symbols = symbolsStr.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
@@ -316,16 +364,19 @@ function transformImports(content, config) {
|
|
|
316
364
|
/from ['"]\.\/hooks\//g,
|
|
317
365
|
`from './`
|
|
318
366
|
);
|
|
367
|
+
result = result.replace(/from (['"])\.\.\/(?!\.\.\/)/g, `from $1./`);
|
|
319
368
|
return result;
|
|
320
369
|
}
|
|
321
370
|
|
|
322
371
|
// src/utils/fetch.ts
|
|
323
|
-
import
|
|
372
|
+
import path5 from "path";
|
|
324
373
|
import fs4 from "fs";
|
|
374
|
+
import { fileURLToPath } from "url";
|
|
325
375
|
var BASE_URL = "https://raw.githubusercontent.com/mcp-elements/ui/main/packages";
|
|
376
|
+
var HERE = path5.dirname(fileURLToPath(import.meta.url));
|
|
326
377
|
async function fetchFile(relativePath, local = false) {
|
|
327
378
|
if (local) {
|
|
328
|
-
const localPath =
|
|
379
|
+
const localPath = path5.join(HERE, "..", "..", relativePath);
|
|
329
380
|
if (!fs4.existsSync(localPath)) {
|
|
330
381
|
throw new Error(`Local file not found: ${localPath}`);
|
|
331
382
|
}
|
|
@@ -396,7 +447,7 @@ var addCommand = new Command2("add").description("Add components to your project
|
|
|
396
447
|
if (!component) continue;
|
|
397
448
|
console.log(` ${pc2.cyan(name)} ${component.type === "css-only" ? "(CSS)" : "(interactive)"}`);
|
|
398
449
|
const framework = config.framework;
|
|
399
|
-
const componentDir =
|
|
450
|
+
const componentDir = path6.join(cwd, config.aliases.components);
|
|
400
451
|
await ensureDir(componentDir);
|
|
401
452
|
const files = component.files[framework];
|
|
402
453
|
const cssFile = component.files.css;
|
|
@@ -407,8 +458,8 @@ var addCommand = new Command2("add").description("Add components to your project
|
|
|
407
458
|
}
|
|
408
459
|
const filesToCopy = Array.isArray(files) ? files : [files];
|
|
409
460
|
for (const file of filesToCopy) {
|
|
410
|
-
const fileName =
|
|
411
|
-
const destPath =
|
|
461
|
+
const fileName = path6.basename(file);
|
|
462
|
+
const destPath = path6.join(componentDir, fileName);
|
|
412
463
|
if (fs5.existsSync(destPath) && !options.overwrite) {
|
|
413
464
|
console.log(pc2.yellow(` Skipped: ${fileName} (already exists, use --overwrite)`));
|
|
414
465
|
continue;
|
|
@@ -423,10 +474,10 @@ var addCommand = new Command2("add").description("Add components to your project
|
|
|
423
474
|
}
|
|
424
475
|
}
|
|
425
476
|
if (coreFile && component.type === "interactive") {
|
|
426
|
-
const utilsDir =
|
|
477
|
+
const utilsDir = path6.join(cwd, config.aliases.utils);
|
|
427
478
|
await ensureDir(utilsDir);
|
|
428
|
-
const coreFileName =
|
|
429
|
-
const coreDest =
|
|
479
|
+
const coreFileName = path6.basename(coreFile);
|
|
480
|
+
const coreDest = path6.join(utilsDir, coreFileName);
|
|
430
481
|
if (!fs5.existsSync(coreDest) || options.overwrite) {
|
|
431
482
|
try {
|
|
432
483
|
const coreContent = await fetchFile(coreFile, isLocal);
|
|
@@ -440,8 +491,8 @@ var addCommand = new Command2("add").description("Add components to your project
|
|
|
440
491
|
for (const dep of coreDeps) {
|
|
441
492
|
if (copiedCoreDeps.has(dep)) continue;
|
|
442
493
|
copiedCoreDeps.add(dep);
|
|
443
|
-
const depFileName =
|
|
444
|
-
const depDest =
|
|
494
|
+
const depFileName = path6.basename(dep);
|
|
495
|
+
const depDest = path6.join(utilsDir, depFileName);
|
|
445
496
|
if (fs5.existsSync(depDest) && !options.overwrite) continue;
|
|
446
497
|
try {
|
|
447
498
|
const depContent = await fetchFile(dep, isLocal);
|
|
@@ -453,13 +504,13 @@ var addCommand = new Command2("add").description("Add components to your project
|
|
|
453
504
|
}
|
|
454
505
|
}
|
|
455
506
|
if (component.type === "css-only") {
|
|
456
|
-
const utilsDir =
|
|
507
|
+
const utilsDir = path6.join(cwd, config.aliases.utils);
|
|
457
508
|
await ensureDir(utilsDir);
|
|
458
509
|
for (const dep of registry.meta.sharedCoreDeps) {
|
|
459
510
|
if (copiedCoreDeps.has(dep)) continue;
|
|
460
511
|
copiedCoreDeps.add(dep);
|
|
461
|
-
const depFileName =
|
|
462
|
-
const depDest =
|
|
512
|
+
const depFileName = path6.basename(dep);
|
|
513
|
+
const depDest = path6.join(utilsDir, depFileName);
|
|
463
514
|
if (fs5.existsSync(depDest) && !options.overwrite) continue;
|
|
464
515
|
try {
|
|
465
516
|
const depContent = await fetchFile(dep, isLocal);
|
|
@@ -471,11 +522,11 @@ var addCommand = new Command2("add").description("Add components to your project
|
|
|
471
522
|
}
|
|
472
523
|
}
|
|
473
524
|
if (cssFile) {
|
|
474
|
-
const cssDir =
|
|
475
|
-
const cssComponentsDir =
|
|
525
|
+
const cssDir = path6.join(cwd, path6.dirname(config.tailwind.css));
|
|
526
|
+
const cssComponentsDir = path6.join(cssDir, "components");
|
|
476
527
|
await ensureDir(cssComponentsDir);
|
|
477
|
-
const cssFileName =
|
|
478
|
-
const cssDest =
|
|
528
|
+
const cssFileName = path6.basename(cssFile);
|
|
529
|
+
const cssDest = path6.join(cssComponentsDir, cssFileName);
|
|
479
530
|
if (!fs5.existsSync(cssDest) || options.overwrite) {
|
|
480
531
|
try {
|
|
481
532
|
const cssContent = await fetchFile(cssFile, isLocal);
|
|
@@ -485,6 +536,24 @@ var addCommand = new Command2("add").description("Add components to your project
|
|
|
485
536
|
console.log(pc2.red(` Failed: ${cssFileName} \u2014 ${err.message}`));
|
|
486
537
|
}
|
|
487
538
|
}
|
|
539
|
+
const globalCssPath = path6.join(cwd, config.tailwind.css);
|
|
540
|
+
const importLine = `@import './components/${cssFileName}';`;
|
|
541
|
+
try {
|
|
542
|
+
const existing = fs5.existsSync(globalCssPath) ? fs5.readFileSync(globalCssPath, "utf-8") : "";
|
|
543
|
+
if (!existing.includes(importLine)) {
|
|
544
|
+
fs5.writeFileSync(
|
|
545
|
+
globalCssPath,
|
|
546
|
+
existing ? `${importLine}
|
|
547
|
+
${existing}` : `${importLine}
|
|
548
|
+
`
|
|
549
|
+
);
|
|
550
|
+
console.log(pc2.green(` Linked: ${config.tailwind.css} \u2190 components/${cssFileName}`));
|
|
551
|
+
}
|
|
552
|
+
} catch (err) {
|
|
553
|
+
console.log(
|
|
554
|
+
pc2.yellow(` Could not link CSS into ${config.tailwind.css}: ${err.message}`)
|
|
555
|
+
);
|
|
556
|
+
}
|
|
488
557
|
}
|
|
489
558
|
}
|
|
490
559
|
console.log(pc2.bold(pc2.green("\n Done!\n")));
|
|
@@ -493,7 +562,7 @@ var addCommand = new Command2("add").description("Add components to your project
|
|
|
493
562
|
// src/commands/theme.ts
|
|
494
563
|
import { Command as Command3 } from "commander";
|
|
495
564
|
import pc3 from "picocolors";
|
|
496
|
-
import
|
|
565
|
+
import path7 from "path";
|
|
497
566
|
var themeCommand = new Command3("theme").description("Manage themes").argument("<theme>", "Theme to add (dark, glass)").option("--local", "Read files from local monorepo (dev only)", false).action(async (theme, options) => {
|
|
498
567
|
const cwd = process.cwd();
|
|
499
568
|
const config = loadConfig(cwd);
|
|
@@ -513,11 +582,11 @@ var themeCommand = new Command3("theme").description("Manage themes").argument("
|
|
|
513
582
|
console.log(pc3.bold("\n Glass theme\n"));
|
|
514
583
|
try {
|
|
515
584
|
const glassContent = await fetchFile("css/themes/glass.css", options.local);
|
|
516
|
-
const cssDir =
|
|
585
|
+
const cssDir = path7.join(cwd, path7.dirname(config.tailwind.css));
|
|
517
586
|
await ensureDir(cssDir);
|
|
518
|
-
const destPath =
|
|
587
|
+
const destPath = path7.join(cssDir, "glass.css");
|
|
519
588
|
await writeFile(destPath, glassContent);
|
|
520
|
-
console.log(pc3.green(` Created: ${
|
|
589
|
+
console.log(pc3.green(` Created: ${path7.relative(cwd, destPath)}`));
|
|
521
590
|
console.log("\n Import it in your main CSS file:");
|
|
522
591
|
console.log(pc3.cyan(`
|
|
523
592
|
@import './glass.css';`));
|
|
@@ -545,17 +614,35 @@ program.addCommand(initCommand);
|
|
|
545
614
|
program.addCommand(addCommand);
|
|
546
615
|
program.addCommand(themeCommand);
|
|
547
616
|
program.command("list").description("List all available components").action(async () => {
|
|
548
|
-
const
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
617
|
+
const pc4 = (await import("picocolors")).default;
|
|
618
|
+
const { registry: registry2 } = await import("./resolve-3LDLIADF.js");
|
|
619
|
+
const allNames = Object.keys(registry2.components);
|
|
620
|
+
const mcpNames = allNames.filter((name) => {
|
|
552
621
|
const comp = registry2.components[name];
|
|
553
|
-
|
|
554
|
-
|
|
622
|
+
return comp.category === "mcp" || (comp.tags ?? []).includes("mcp") || name.startsWith("mcp-");
|
|
623
|
+
});
|
|
624
|
+
const extraNames = allNames.filter((name) => !mcpNames.includes(name));
|
|
625
|
+
function printGroup(names) {
|
|
626
|
+
for (const name of names) {
|
|
627
|
+
const comp = registry2.components[name];
|
|
628
|
+
const type = comp.type === "css-only" ? pc4.dim("(CSS-only)") : pc4.cyan("(interactive)");
|
|
629
|
+
console.log(` ${pc4.bold(name)} ${type}`);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
if (mcpNames.length > 0) {
|
|
633
|
+
console.log("\n" + pc4.bold(pc4.magenta("MCP-native")) + "\n");
|
|
634
|
+
printGroup(mcpNames);
|
|
635
|
+
}
|
|
636
|
+
if (extraNames.length > 0) {
|
|
637
|
+
console.log("\n" + pc4.bold("Extras") + pc4.dim(" \u2014 base UI primitives") + "\n");
|
|
638
|
+
printGroup(extraNames);
|
|
555
639
|
}
|
|
556
640
|
console.log(`
|
|
557
|
-
Total: ${
|
|
558
|
-
|
|
641
|
+
Total: ${allNames.length} component${allNames.length !== 1 ? "s" : ""}`);
|
|
642
|
+
if (mcpNames.length > 0) {
|
|
643
|
+
console.log(pc4.dim(` ${mcpNames.length} MCP-native \xB7 ${extraNames.length} extras`));
|
|
644
|
+
}
|
|
645
|
+
console.log();
|
|
559
646
|
});
|
|
560
647
|
program.parse();
|
|
561
648
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/utils/detect.ts","../src/utils/fs.ts","../src/commands/add.ts","../src/utils/transform.ts","../src/utils/fetch.ts","../src/commands/theme.ts"],"sourcesContent":["import { Command } from 'commander'\nimport { initCommand } from './commands/init.js'\nimport { addCommand } from './commands/add.js'\nimport { themeCommand } from './commands/theme.js'\n\nconst program = new Command()\n\nprogram\n .name('mcp-elements')\n .description('Framework-agnostic UI components with shadcn-style CLI')\n .version('0.1.0')\n\nprogram.addCommand(initCommand)\nprogram.addCommand(addCommand)\nprogram.addCommand(themeCommand)\n\n// List command\nprogram\n .command('list')\n .description('List all available components')\n .action(async () => {\n const { registry } = await import('./registry/resolve.js')\n const components = Object.keys(registry.components)\n console.log('\\nAvailable components:\\n')\n for (const name of components) {\n const comp = registry.components[name]\n const type = comp.type === 'css-only' ? '(CSS-only)' : '(interactive)'\n console.log(` ${name} ${type}`)\n }\n console.log(`\\nTotal: ${components.length} components\\n`)\n })\n\nprogram.parse()\n","import { Command } from 'commander'\nimport prompts from 'prompts'\nimport pc from 'picocolors'\nimport { detectFramework } from '../utils/detect.js'\nimport { writeFile, ensureDir, fileExists } from '../utils/fs.js'\nimport path from 'node:path'\nimport fs from 'node:fs'\n\nexport const initCommand = new Command('init')\n .description('Initialize mcp-elements in your project')\n .action(async () => {\n console.log(pc.bold('\\n mcp-elements init\\n'))\n\n const cwd = process.cwd()\n\n // Check if already initialized\n if (await fileExists(path.join(cwd, 'mcp-elements.json'))) {\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: 'mcp-elements.json already exists. Overwrite?',\n initial: false,\n })\n if (!overwrite) {\n console.log(pc.yellow(' Cancelled.'))\n return\n }\n }\n\n // Detect framework\n let framework = detectFramework(cwd)\n\n if (!framework) {\n const response = await prompts({\n type: 'select',\n name: 'framework',\n message: 'Which framework are you using?',\n choices: [\n { title: 'React', value: 'react' },\n { title: 'Angular', value: 'angular' },\n ],\n })\n framework = response.framework\n } else {\n console.log(pc.green(` Detected framework: ${framework}`))\n }\n\n if (!framework) {\n console.log(pc.red(' No framework selected. Aborting.'))\n return\n }\n\n // Ask for component directory\n const defaultComponentDir = framework === 'react'\n ? 'src/components/ui'\n : 'src/app/components/ui'\n\n const { componentDir, cssPath, typescript } = await prompts([\n {\n type: 'text',\n name: 'componentDir',\n message: 'Where should components be installed?',\n initial: defaultComponentDir,\n },\n {\n type: 'text',\n name: 'cssPath',\n message: 'Where is your global CSS file?',\n initial: framework === 'react' ? 'src/index.css' : 'src/styles.css',\n },\n {\n type: 'confirm',\n name: 'typescript',\n message: 'Are you using TypeScript?',\n initial: true,\n },\n ])\n\n // Create config\n const config = {\n $schema: 'https://mcp-elements.dev/schema.json',\n framework,\n typescript,\n tailwind: {\n css: cssPath,\n baseColor: 'zinc',\n },\n aliases: {\n components: componentDir,\n utils: framework === 'react' ? 'src/lib/utils' : 'src/app/lib/utils',\n },\n }\n\n // Write config file\n await writeFile(\n path.join(cwd, 'mcp-elements.json'),\n JSON.stringify(config, null, 2)\n )\n console.log(pc.green(' Created mcp-elements.json'))\n\n // Ensure component directory exists\n await ensureDir(path.join(cwd, componentDir))\n console.log(pc.green(` Created ${componentDir}/`))\n\n // Ensure utils directory and create cn utility\n const utilsDir = config.aliases.utils\n await ensureDir(path.join(cwd, utilsDir))\n\n const ext = typescript ? '.ts' : '.js'\n const cnContent = `export function cn(...inputs${typescript ? ': (string | undefined | null | false)[]' : ''})${typescript ? ': string' : ''} {\n return inputs.filter(Boolean).join(' ')\n}\n`\n await writeFile(path.join(cwd, utilsDir, `cn${ext}`), cnContent)\n console.log(pc.green(` Created ${utilsDir}/cn${ext}`))\n\n // Copy base CSS tokens\n const baseCssContent = `/* mcp-elements design tokens */\n@import 'tailwindcss';\n\n@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));\n\n@theme {\n --color-background: oklch(1 0 0);\n --color-foreground: oklch(0.145 0 0);\n --color-primary: oklch(0.205 0.042 265.755);\n --color-primary-foreground: oklch(0.985 0 0);\n --color-secondary: oklch(0.97 0.001 286.375);\n --color-secondary-foreground: oklch(0.205 0.042 265.755);\n --color-accent: oklch(0.97 0.001 286.375);\n --color-accent-foreground: oklch(0.205 0.042 265.755);\n --color-muted: oklch(0.97 0.001 286.375);\n --color-muted-foreground: oklch(0.556 0.019 286);\n --color-destructive: oklch(0.577 0.245 27.325);\n --color-destructive-foreground: oklch(0.985 0 0);\n --color-border: oklch(0.922 0.004 286.32);\n --color-input: oklch(0.922 0.004 286.32);\n --color-ring: oklch(0.708 0.028 256);\n --color-card: oklch(1 0 0);\n --color-card-foreground: oklch(0.145 0 0);\n --color-popover: oklch(1 0 0);\n --color-popover-foreground: oklch(0.145 0 0);\n\n --radius-sm: 0.25rem;\n --radius-md: calc(var(--radius-sm) + 0.125rem);\n --radius-lg: calc(var(--radius-sm) + 0.25rem);\n --radius-xl: calc(var(--radius-sm) + 0.5rem);\n}\n\n@layer base {\n [data-theme='dark'] {\n --color-background: oklch(0.145 0 0);\n --color-foreground: oklch(0.985 0 0);\n --color-primary: oklch(0.985 0 0);\n --color-primary-foreground: oklch(0.205 0.042 265.755);\n --color-secondary: oklch(0.269 0.007 286.033);\n --color-secondary-foreground: oklch(0.985 0 0);\n --color-muted: oklch(0.269 0.007 286.033);\n --color-muted-foreground: oklch(0.708 0.014 285.823);\n --color-accent: oklch(0.269 0.007 286.033);\n --color-accent-foreground: oklch(0.985 0 0);\n --color-destructive: oklch(0.704 0.191 22.216);\n --color-border: oklch(0.269 0.007 286.033);\n --color-input: oklch(0.269 0.007 286.033);\n --color-ring: oklch(0.442 0.017 285.786);\n --color-card: oklch(0.145 0 0);\n --color-card-foreground: oklch(0.985 0 0);\n --color-popover: oklch(0.145 0 0);\n --color-popover-foreground: oklch(0.985 0 0);\n }\n}\n`\n\n const cssFullPath = path.join(cwd, cssPath)\n if (await fileExists(cssFullPath)) {\n const existing = fs.readFileSync(cssFullPath, 'utf-8')\n if (!existing.includes('mcp-elements design tokens')) {\n fs.writeFileSync(cssFullPath, baseCssContent + '\\n' + existing)\n console.log(pc.green(` Added design tokens to ${cssPath}`))\n } else {\n console.log(pc.yellow(` Design tokens already exist in ${cssPath}`))\n }\n } else {\n await writeFile(cssFullPath, baseCssContent)\n console.log(pc.green(` Created ${cssPath} with design tokens`))\n }\n\n console.log(pc.bold(pc.green('\\n mcp-elements initialized successfully!\\n')))\n console.log(` Run ${pc.cyan('npx mcp-elements add button')} to add your first component.\\n`)\n })\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nexport interface SnxConfig {\n $schema?: string\n framework: string\n typescript: boolean\n tailwind: {\n css: string\n baseColor: string\n }\n aliases: {\n components: string\n utils: string\n }\n}\n\nexport function detectFramework(cwd: string): string | null {\n const pkgPath = path.join(cwd, 'package.json')\n\n if (!fs.existsSync(pkgPath)) return null\n\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))\n const allDeps = {\n ...pkg.dependencies,\n ...pkg.devDependencies,\n }\n\n if (allDeps['@angular/core']) return 'angular'\n if (allDeps['react']) return 'react'\n\n return null\n } catch {\n return null\n }\n}\n\nexport function loadConfig(cwd: string): SnxConfig | null {\n const configPath = path.join(cwd, 'mcp-elements.json')\n\n if (!fs.existsSync(configPath)) return null\n\n try {\n return JSON.parse(fs.readFileSync(configPath, 'utf-8')) as SnxConfig\n } catch {\n return null\n }\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n const dir = path.dirname(filePath)\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n fs.writeFileSync(filePath, content, 'utf-8')\n}\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n if (!fs.existsSync(dirPath)) {\n fs.mkdirSync(dirPath, { recursive: true })\n }\n}\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n return fs.existsSync(filePath)\n}\n\nexport async function readFile(filePath: string): Promise<string> {\n return fs.readFileSync(filePath, 'utf-8')\n}\n\nexport async function copyFile(src: string, dest: string): Promise<void> {\n const dir = path.dirname(dest)\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n fs.copyFileSync(src, dest)\n}\n","import { Command } from 'commander'\nimport pc from 'picocolors'\nimport path from 'node:path'\nimport fs from 'node:fs'\nimport prompts from 'prompts'\nimport { registry, resolveComponentDeps, resolveCoreDeps } from '../registry/resolve.js'\nimport { loadConfig } from '../utils/detect.js'\nimport { writeFile, ensureDir } from '../utils/fs.js'\nimport { transformImports } from '../utils/transform.js'\nimport { fetchFile } from '../utils/fetch.js'\n\nexport const addCommand = new Command('add')\n .description('Add components to your project')\n .argument('[components...]', 'Components to add')\n .option('-y, --yes', 'Skip confirmation', false)\n .option('-o, --overwrite', 'Overwrite existing files', false)\n .option('--local', 'Read files from local monorepo (dev only)', false)\n .action(async (componentNames: string[], options) => {\n const cwd = process.cwd()\n const config = loadConfig(cwd)\n\n if (!config) {\n console.log(pc.red('\\n mcp-elements.json not found. Run `npx mcp-elements init` first.\\n'))\n return\n }\n\n // Interactive picker when no args provided\n if (!componentNames || componentNames.length === 0) {\n const allComponents = Object.keys(registry.components)\n const response = await prompts({\n type: 'multiselect',\n name: 'selected',\n message: 'Which components would you like to add?',\n choices: allComponents.map(name => {\n const comp = registry.components[name]\n return {\n title: `${name} ${comp.type === 'css-only' ? pc.dim('(CSS)') : pc.cyan('(interactive)')}`,\n value: name,\n }\n }),\n hint: '- Space to select, Enter to confirm',\n })\n\n if (!response.selected || response.selected.length === 0) {\n console.log(pc.yellow('\\n No components selected.\\n'))\n return\n }\n\n componentNames = response.selected\n }\n\n // Validate component names\n const invalid = componentNames.filter(name => !registry.components[name])\n if (invalid.length > 0) {\n console.log(pc.red(`\\n Unknown components: ${invalid.join(', ')}`))\n console.log(` Run ${pc.cyan('npx mcp-elements list')} to see available components.\\n`)\n return\n }\n\n // Resolve all dependencies\n const allComponents = new Set<string>()\n for (const name of componentNames) {\n const deps = resolveComponentDeps(name)\n for (const dep of deps) {\n allComponents.add(dep)\n }\n allComponents.add(name)\n }\n\n console.log(pc.bold(`\\n Adding ${allComponents.size} component(s):\\n`))\n\n const isLocal = options.local\n\n // Track which coreDeps we've already copied\n const copiedCoreDeps = new Set<string>()\n\n for (const name of allComponents) {\n const component = registry.components[name]\n if (!component) continue\n\n console.log(` ${pc.cyan(name)} ${component.type === 'css-only' ? '(CSS)' : '(interactive)'}`)\n\n const framework = config.framework as 'react' | 'angular'\n const componentDir = path.join(cwd, config.aliases.components)\n await ensureDir(componentDir)\n\n // Get the files to copy for this framework\n const files = component.files[framework]\n const cssFile = component.files.css\n const coreFile = component.files.core\n\n if (!files) {\n console.log(pc.yellow(` Skipped: no ${framework} adapter`))\n continue\n }\n\n // Copy framework-specific files\n const filesToCopy = Array.isArray(files) ? files : [files]\n for (const file of filesToCopy) {\n const fileName = path.basename(file)\n const destPath = path.join(componentDir, fileName)\n\n if (fs.existsSync(destPath) && !options.overwrite) {\n console.log(pc.yellow(` Skipped: ${fileName} (already exists, use --overwrite)`))\n continue\n }\n\n try {\n let content = await fetchFile(file, isLocal)\n content = transformImports(content, config)\n await writeFile(destPath, content)\n console.log(pc.green(` Created: ${config.aliases.components}/${fileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${fileName} — ${(err as Error).message}`))\n }\n }\n\n // Copy core logic file if interactive\n if (coreFile && component.type === 'interactive') {\n const utilsDir = path.join(cwd, config.aliases.utils)\n await ensureDir(utilsDir)\n const coreFileName = path.basename(coreFile)\n const coreDest = path.join(utilsDir, coreFileName)\n\n if (!fs.existsSync(coreDest) || options.overwrite) {\n try {\n const coreContent = await fetchFile(coreFile, isLocal)\n await writeFile(coreDest, coreContent)\n console.log(pc.green(` Created: ${config.aliases.utils}/${coreFileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${coreFileName} — ${(err as Error).message}`))\n }\n }\n\n // Copy coreDeps (dom.ts, keyboard.ts, etc.)\n const coreDeps = resolveCoreDeps(name)\n for (const dep of coreDeps) {\n if (copiedCoreDeps.has(dep)) continue\n copiedCoreDeps.add(dep)\n\n const depFileName = path.basename(dep)\n const depDest = path.join(utilsDir, depFileName)\n\n if (fs.existsSync(depDest) && !options.overwrite) continue\n\n try {\n const depContent = await fetchFile(dep, isLocal)\n await writeFile(depDest, depContent)\n console.log(pc.green(` Created: ${config.aliases.utils}/${depFileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${depFileName} — ${(err as Error).message}`))\n }\n }\n }\n\n // Always copy shared coreDeps (cn.ts) for any component\n if (component.type === 'css-only') {\n const utilsDir = path.join(cwd, config.aliases.utils)\n await ensureDir(utilsDir)\n\n for (const dep of registry.meta.sharedCoreDeps) {\n if (copiedCoreDeps.has(dep)) continue\n copiedCoreDeps.add(dep)\n\n const depFileName = path.basename(dep)\n const depDest = path.join(utilsDir, depFileName)\n\n if (fs.existsSync(depDest) && !options.overwrite) continue\n\n try {\n const depContent = await fetchFile(dep, isLocal)\n await writeFile(depDest, depContent)\n console.log(pc.green(` Created: ${config.aliases.utils}/${depFileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${depFileName} — ${(err as Error).message}`))\n }\n }\n }\n\n // Copy CSS file\n if (cssFile) {\n const cssDir = path.join(cwd, path.dirname(config.tailwind.css))\n const cssComponentsDir = path.join(cssDir, 'components')\n await ensureDir(cssComponentsDir)\n const cssFileName = path.basename(cssFile)\n const cssDest = path.join(cssComponentsDir, cssFileName)\n\n if (!fs.existsSync(cssDest) || options.overwrite) {\n try {\n const cssContent = await fetchFile(cssFile, isLocal)\n await writeFile(cssDest, cssContent)\n console.log(pc.green(` Created: components/${cssFileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${cssFileName} — ${(err as Error).message}`))\n }\n }\n }\n }\n\n console.log(pc.bold(pc.green('\\n Done!\\n')))\n })\n","import type { SnxConfig } from './detect.js'\n\n// Maps each exported symbol to its source file (relative to utils dir)\nconst SYMBOL_TO_FILE: Record<string, string> = {\n // utils/cn.ts\n cn: 'cn',\n // utils/dom.ts\n trapFocus: 'dom',\n lockScroll: 'dom',\n createClickOutsideHandler: 'dom',\n getFocusableElements: 'dom',\n // utils/keyboard.ts\n Keys: 'keyboard',\n getNextIndex: 'keyboard',\n handleArrowNavigation: 'keyboard',\n KeyboardDirection: 'keyboard',\n // dialog\n createDialog: 'dialog',\n DialogConfig: 'dialog',\n // tabs\n createTabs: 'tabs',\n TabsConfig: 'tabs',\n TabItem: 'tabs',\n // accordion\n createAccordion: 'accordion',\n AccordionConfig: 'accordion',\n AccordionItemConfig: 'accordion',\n // select\n createSelect: 'select',\n SelectConfig: 'select',\n SelectOption: 'select',\n // tooltip\n createTooltip: 'tooltip',\n TooltipConfig: 'tooltip',\n // popover\n createPopover: 'popover',\n PopoverConfig: 'popover',\n // toast\n toast: 'toast',\n createToastManager: 'toast',\n Toast: 'toast',\n ToastConfig: 'toast',\n ToastState: 'toast',\n // drawer\n createDrawer: 'drawer',\n DrawerConfig: 'drawer',\n // dropdown-menu\n createDropdownMenu: 'dropdown-menu',\n DropdownMenuConfig: 'dropdown-menu',\n DropdownMenuItem: 'dropdown-menu',\n // switch\n createSwitch: 'switch',\n SwitchConfig: 'switch',\n}\n\n// Regex to match import statements from @mcp-elements/core\nconst CORE_IMPORT_RE = /import\\s+(type\\s+)?{([^}]+)}\\s+from\\s+['\"]@mcp-elements\\/core['\"]/g\n\nexport function transformImports(content: string, config: SnxConfig): string {\n let result = content\n const utilsPath = config.aliases.utils\n\n // Collect all @mcp-elements/core imports and replace them\n result = result.replace(CORE_IMPORT_RE, (match, typeKeyword, symbolsStr) => {\n const isTypeOnly = !!typeKeyword\n const symbols = symbolsStr\n .split(',')\n .map((s: string) => s.trim())\n .filter((s: string) => s.length > 0)\n\n // Group symbols by target file\n const groups: Record<string, { symbols: string[]; hasType: boolean }> = {}\n\n for (const sym of symbols) {\n // Handle \"type Foo\" within a value import\n const isInlineType = sym.startsWith('type ')\n const cleanSym = isInlineType ? sym.replace('type ', '') : sym\n const targetFile = SYMBOL_TO_FILE[cleanSym]\n\n if (!targetFile) {\n // Unknown symbol — keep it pointing to cn as fallback\n const file = 'cn'\n if (!groups[file]) groups[file] = { symbols: [], hasType: false }\n groups[file].symbols.push(sym)\n continue\n }\n\n if (!groups[targetFile]) groups[targetFile] = { symbols: [], hasType: false }\n if (isTypeOnly || isInlineType) {\n groups[targetFile].hasType = true\n }\n groups[targetFile].symbols.push(sym)\n }\n\n // Build replacement import statements\n const imports: string[] = []\n for (const [file, group] of Object.entries(groups)) {\n const allType = isTypeOnly || group.symbols.every(s => s.startsWith('type '))\n const keyword = allType ? 'import type' : 'import'\n imports.push(`${keyword} { ${group.symbols.join(', ')} } from '${utilsPath}/${file}'`)\n }\n\n return imports.join('\\n')\n })\n\n // Transform relative hook imports to match component directory\n result = result.replace(\n /from ['\"]\\.\\/hooks\\//g,\n `from './`\n )\n\n return result\n}\n","import path from 'node:path'\nimport fs from 'node:fs'\n\nconst BASE_URL = 'https://raw.githubusercontent.com/mcp-elements/ui/main/packages'\n\nexport async function fetchFile(relativePath: string, local = false): Promise<string> {\n if (local) {\n const localPath = path.join(__dirname, '..', '..', '..', relativePath)\n if (!fs.existsSync(localPath)) {\n throw new Error(`Local file not found: ${localPath}`)\n }\n return fs.readFileSync(localPath, 'utf-8')\n }\n\n const url = `${BASE_URL}/${relativePath}`\n const response = await fetch(url)\n\n if (!response.ok) {\n throw new Error(\n `Failed to fetch ${relativePath} (HTTP ${response.status}). ` +\n `Make sure the file exists at ${url}`\n )\n }\n\n return response.text()\n}\n","import { Command } from 'commander'\nimport pc from 'picocolors'\nimport path from 'node:path'\nimport { loadConfig } from '../utils/detect.js'\nimport { writeFile, ensureDir } from '../utils/fs.js'\nimport { fetchFile } from '../utils/fetch.js'\n\nexport const themeCommand = new Command('theme')\n .description('Manage themes')\n .argument('<theme>', 'Theme to add (dark, glass)')\n .option('--local', 'Read files from local monorepo (dev only)', false)\n .action(async (theme: string, options) => {\n const cwd = process.cwd()\n const config = loadConfig(cwd)\n\n if (!config) {\n console.log(pc.red('\\n mcp-elements.json not found. Run `npx mcp-elements init` first.\\n'))\n return\n }\n\n if (theme === 'dark') {\n console.log(pc.bold('\\n Dark theme\\n'))\n console.log(' Dark theme tokens are already included in your base CSS.')\n console.log(' To activate dark mode, add this to your HTML:')\n console.log(pc.cyan('\\n <html data-theme=\"dark\">'))\n console.log('\\n Or toggle with JavaScript:')\n console.log(pc.cyan(\" document.documentElement.setAttribute('data-theme', 'dark')\"))\n console.log()\n } else if (theme === 'glass') {\n console.log(pc.bold('\\n Glass theme\\n'))\n\n try {\n const glassContent = await fetchFile('css/themes/glass.css', options.local)\n const cssDir = path.join(cwd, path.dirname(config.tailwind.css))\n await ensureDir(cssDir)\n const destPath = path.join(cssDir, 'glass.css')\n await writeFile(destPath, glassContent)\n\n console.log(pc.green(` Created: ${path.relative(cwd, destPath)}`))\n console.log('\\n Import it in your main CSS file:')\n console.log(pc.cyan(`\\n @import './glass.css';`))\n console.log('\\n Then activate by adding to your HTML:')\n console.log(pc.cyan('\\n <html data-theme=\"glass\">'))\n console.log('\\n Or toggle with JavaScript:')\n console.log(pc.cyan(\" document.documentElement.setAttribute('data-theme', 'glass')\"))\n console.log()\n } catch (err) {\n console.log(pc.red(` Failed to fetch glass theme: ${(err as Error).message}\\n`))\n }\n } else {\n console.log(pc.yellow(`\\n Theme \"${theme}\" is not available.`))\n console.log(` Available themes: ${pc.cyan('dark')}, ${pc.cyan('glass')}\\n`)\n }\n })\n"],"mappings":";;;;;;;;AAAA,SAAS,WAAAA,gBAAe;;;ACAxB,SAAS,eAAe;AACxB,OAAO,aAAa;AACpB,OAAO,QAAQ;;;ACFf,OAAO,QAAQ;AACf,OAAO,UAAU;AAgBV,SAAS,gBAAgB,KAA4B;AAC1D,QAAM,UAAU,KAAK,KAAK,KAAK,cAAc;AAE7C,MAAI,CAAC,GAAG,WAAW,OAAO,EAAG,QAAO;AAEpC,MAAI;AACF,UAAM,MAAM,KAAK,MAAM,GAAG,aAAa,SAAS,OAAO,CAAC;AACxD,UAAM,UAAU;AAAA,MACd,GAAG,IAAI;AAAA,MACP,GAAG,IAAI;AAAA,IACT;AAEA,QAAI,QAAQ,eAAe,EAAG,QAAO;AACrC,QAAI,QAAQ,OAAO,EAAG,QAAO;AAE7B,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,WAAW,KAA+B;AACxD,QAAM,aAAa,KAAK,KAAK,KAAK,mBAAmB;AAErD,MAAI,CAAC,GAAG,WAAW,UAAU,EAAG,QAAO;AAEvC,MAAI;AACF,WAAO,KAAK,MAAM,GAAG,aAAa,YAAY,OAAO,CAAC;AAAA,E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,IAAI,2BAA2B;AACvC,aAAW,QAAQ,YAAY;AAC7B,UAAM,OAAOA,UAAS,WAAW,IAAI;AACrC,UAAM,OAAO,KAAK,SAAS,aAAa,eAAe;AACvD,YAAQ,IAAI,KAAK,IAAI,IAAI,IAAI,EAAE;AAAA,EACjC;AACA,UAAQ,IAAI;AAAA,SAAY,WAAW,MAAM;AAAA,CAAe;AAC1D,CAAC;AAEH,QAAQ,MAAM;","names":["Command","fs","path","path","fs","Command","pc","path","fs","prompts","path","fs","Command","pc","allComponents","prompts","path","fs","Command","pc","path","Command","pc","path","Command","registry"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/utils/detect.ts","../src/utils/fs.ts","../src/commands/add.ts","../src/utils/transform.ts","../src/utils/fetch.ts","../src/commands/theme.ts"],"sourcesContent":["import { Command } from 'commander'\nimport { initCommand } from './commands/init.js'\nimport { addCommand } from './commands/add.js'\nimport { themeCommand } from './commands/theme.js'\n\nconst program = new Command()\n\nprogram\n .name('mcp-elements')\n .description('Framework-agnostic UI components with shadcn-style CLI')\n .version('0.1.0')\n\nprogram.addCommand(initCommand)\nprogram.addCommand(addCommand)\nprogram.addCommand(themeCommand)\n\n// List command\nprogram\n .command('list')\n .description('List all available components')\n .action(async () => {\n const pc = (await import('picocolors')).default\n const { registry } = await import('./registry/resolve.js')\n const allNames = Object.keys(registry.components)\n\n // Split into MCP-native (category/tag = 'mcp') vs extras\n const mcpNames = allNames.filter((name) => {\n const comp = registry.components[name]\n return (\n (comp as { category?: string }).category === 'mcp' ||\n ((comp as { tags?: string[] }).tags ?? []).includes('mcp') ||\n name.startsWith('mcp-')\n )\n })\n const extraNames = allNames.filter((name) => !mcpNames.includes(name))\n\n function printGroup(names: string[]) {\n for (const name of names) {\n const comp = registry.components[name]\n const type = comp.type === 'css-only' ? pc.dim('(CSS-only)') : pc.cyan('(interactive)')\n console.log(` ${pc.bold(name)} ${type}`)\n }\n }\n\n if (mcpNames.length > 0) {\n console.log('\\n' + pc.bold(pc.magenta('MCP-native')) + '\\n')\n printGroup(mcpNames)\n }\n\n if (extraNames.length > 0) {\n console.log('\\n' + pc.bold('Extras') + pc.dim(' — base UI primitives') + '\\n')\n printGroup(extraNames)\n }\n\n console.log(`\\nTotal: ${allNames.length} component${allNames.length !== 1 ? 's' : ''}`)\n if (mcpNames.length > 0) {\n console.log(pc.dim(` ${mcpNames.length} MCP-native · ${extraNames.length} extras`))\n }\n console.log()\n })\n\nprogram.parse()\n","import { Command } from 'commander'\nimport prompts from 'prompts'\nimport pc from 'picocolors'\nimport { detectFramework } from '../utils/detect.js'\nimport { writeFile, ensureDir, fileExists } from '../utils/fs.js'\nimport path from 'node:path'\nimport fs from 'node:fs'\n\nexport const initCommand = new Command('init')\n .description('Initialize mcp-elements in your project')\n .action(async () => {\n console.log(pc.bold('\\n mcp-elements init\\n'))\n\n const cwd = process.cwd()\n\n // Check if already initialized\n if (await fileExists(path.join(cwd, 'mcp-elements.json'))) {\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: 'mcp-elements.json already exists. Overwrite?',\n initial: false,\n })\n if (!overwrite) {\n console.log(pc.yellow(' Cancelled.'))\n return\n }\n }\n\n // Detect framework\n let framework = detectFramework(cwd)\n\n if (!framework) {\n const response = await prompts({\n type: 'select',\n name: 'framework',\n message: 'Which framework are you using?',\n choices: [\n { title: 'React', value: 'react' },\n { title: 'Angular', value: 'angular' },\n { title: 'Vue', value: 'vue' },\n ],\n })\n framework = response.framework\n } else {\n console.log(pc.green(` Detected framework: ${framework}`))\n }\n\n if (!framework) {\n console.log(pc.red(' No framework selected. Aborting.'))\n return\n }\n\n // Ask for component directory\n const defaultComponentDir = framework === 'angular'\n ? 'src/app/components/ui'\n : 'src/components/ui'\n\n const { componentDir, cssPath, typescript } = await prompts([\n {\n type: 'text',\n name: 'componentDir',\n message: 'Where should components be installed?',\n initial: defaultComponentDir,\n },\n {\n type: 'text',\n name: 'cssPath',\n message: 'Where is your global CSS file?',\n initial:\n framework === 'react'\n ? 'src/index.css'\n : framework === 'vue'\n ? 'src/style.css'\n : 'src/styles.css',\n },\n {\n type: 'confirm',\n name: 'typescript',\n message: 'Are you using TypeScript?',\n initial: true,\n },\n ])\n\n // Create config\n const config = {\n $schema: 'https://mcp-elements.wearesnx.studio/schema.json',\n framework,\n typescript,\n tailwind: {\n css: cssPath,\n baseColor: 'zinc',\n },\n aliases: {\n components: componentDir,\n utils: framework === 'angular' ? 'src/app/lib/utils' : 'src/lib/utils',\n },\n }\n\n // Write config file\n await writeFile(\n path.join(cwd, 'mcp-elements.json'),\n JSON.stringify(config, null, 2)\n )\n console.log(pc.green(' Created mcp-elements.json'))\n\n // Ensure component directory exists\n await ensureDir(path.join(cwd, componentDir))\n console.log(pc.green(` Created ${componentDir}/`))\n\n // Ensure utils directory and create cn utility\n const utilsDir = config.aliases.utils\n await ensureDir(path.join(cwd, utilsDir))\n\n const ext = typescript ? '.ts' : '.js'\n const cnContent = `export function cn(...inputs${typescript ? ': (string | undefined | null | false)[]' : ''})${typescript ? ': string' : ''} {\n return inputs.filter(Boolean).join(' ')\n}\n`\n await writeFile(path.join(cwd, utilsDir, `cn${ext}`), cnContent)\n console.log(pc.green(` Created ${utilsDir}/cn${ext}`))\n\n // Copy base CSS tokens\n const baseCssContent = `/* mcp-elements design tokens */\n@import 'tailwindcss';\n\n@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));\n\n@theme {\n --color-background: oklch(1 0 0);\n --color-foreground: oklch(0.145 0 0);\n --color-primary: oklch(0.205 0.042 265.755);\n --color-primary-foreground: oklch(0.985 0 0);\n --color-secondary: oklch(0.97 0.001 286.375);\n --color-secondary-foreground: oklch(0.205 0.042 265.755);\n --color-accent: oklch(0.97 0.001 286.375);\n --color-accent-foreground: oklch(0.205 0.042 265.755);\n --color-muted: oklch(0.97 0.001 286.375);\n --color-muted-foreground: oklch(0.556 0.019 286);\n --color-destructive: oklch(0.577 0.245 27.325);\n --color-destructive-foreground: oklch(0.985 0 0);\n --color-border: oklch(0.922 0.004 286.32);\n --color-input: oklch(0.922 0.004 286.32);\n --color-ring: oklch(0.708 0.028 256);\n --color-card: oklch(1 0 0);\n --color-card-foreground: oklch(0.145 0 0);\n --color-popover: oklch(1 0 0);\n --color-popover-foreground: oklch(0.145 0 0);\n\n --radius-sm: 0.25rem;\n --radius-md: calc(var(--radius-sm) + 0.125rem);\n --radius-lg: calc(var(--radius-sm) + 0.25rem);\n --radius-xl: calc(var(--radius-sm) + 0.5rem);\n}\n\n@layer base {\n [data-theme='dark'] {\n --color-background: oklch(0.145 0 0);\n --color-foreground: oklch(0.985 0 0);\n --color-primary: oklch(0.985 0 0);\n --color-primary-foreground: oklch(0.205 0.042 265.755);\n --color-secondary: oklch(0.269 0.007 286.033);\n --color-secondary-foreground: oklch(0.985 0 0);\n --color-muted: oklch(0.269 0.007 286.033);\n --color-muted-foreground: oklch(0.708 0.014 285.823);\n --color-accent: oklch(0.269 0.007 286.033);\n --color-accent-foreground: oklch(0.985 0 0);\n --color-destructive: oklch(0.704 0.191 22.216);\n --color-border: oklch(0.269 0.007 286.033);\n --color-input: oklch(0.269 0.007 286.033);\n --color-ring: oklch(0.442 0.017 285.786);\n --color-card: oklch(0.145 0 0);\n --color-card-foreground: oklch(0.985 0 0);\n --color-popover: oklch(0.145 0 0);\n --color-popover-foreground: oklch(0.985 0 0);\n }\n}\n`\n\n const cssFullPath = path.join(cwd, cssPath)\n if (await fileExists(cssFullPath)) {\n const existing = fs.readFileSync(cssFullPath, 'utf-8')\n if (!existing.includes('mcp-elements design tokens')) {\n fs.writeFileSync(cssFullPath, baseCssContent + '\\n' + existing)\n console.log(pc.green(` Added design tokens to ${cssPath}`))\n } else {\n console.log(pc.yellow(` Design tokens already exist in ${cssPath}`))\n }\n } else {\n await writeFile(cssFullPath, baseCssContent)\n console.log(pc.green(` Created ${cssPath} with design tokens`))\n }\n\n console.log(pc.bold(pc.green('\\n mcp-elements initialized successfully!\\n')))\n console.log(` Run ${pc.cyan('npx mcp-elements add button')} to add your first component.\\n`)\n })\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nexport interface SnxConfig {\n $schema?: string\n framework: string\n typescript: boolean\n tailwind: {\n css: string\n baseColor: string\n }\n aliases: {\n components: string\n utils: string\n }\n}\n\nexport function detectFramework(cwd: string): string | null {\n const pkgPath = path.join(cwd, 'package.json')\n\n if (!fs.existsSync(pkgPath)) return null\n\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))\n const allDeps = {\n ...pkg.dependencies,\n ...pkg.devDependencies,\n }\n\n if (allDeps['@angular/core']) return 'angular'\n if (allDeps['react']) return 'react'\n if (allDeps['vue']) return 'vue'\n\n return null\n } catch {\n return null\n }\n}\n\nexport function loadConfig(cwd: string): SnxConfig | null {\n const configPath = path.join(cwd, 'mcp-elements.json')\n\n if (!fs.existsSync(configPath)) return null\n\n try {\n return JSON.parse(fs.readFileSync(configPath, 'utf-8')) as SnxConfig\n } catch {\n return null\n }\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n const dir = path.dirname(filePath)\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n fs.writeFileSync(filePath, content, 'utf-8')\n}\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n if (!fs.existsSync(dirPath)) {\n fs.mkdirSync(dirPath, { recursive: true })\n }\n}\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n return fs.existsSync(filePath)\n}\n\nexport async function readFile(filePath: string): Promise<string> {\n return fs.readFileSync(filePath, 'utf-8')\n}\n\nexport async function copyFile(src: string, dest: string): Promise<void> {\n const dir = path.dirname(dest)\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true })\n }\n fs.copyFileSync(src, dest)\n}\n","import { Command } from 'commander'\nimport pc from 'picocolors'\nimport path from 'node:path'\nimport fs from 'node:fs'\nimport prompts from 'prompts'\nimport { registry, resolveComponentDeps, resolveCoreDeps } from '../registry/resolve.js'\nimport { loadConfig } from '../utils/detect.js'\nimport { writeFile, ensureDir } from '../utils/fs.js'\nimport { transformImports } from '../utils/transform.js'\nimport { fetchFile } from '../utils/fetch.js'\n\nexport const addCommand = new Command('add')\n .description('Add components to your project')\n .argument('[components...]', 'Components to add')\n .option('-y, --yes', 'Skip confirmation', false)\n .option('-o, --overwrite', 'Overwrite existing files', false)\n .option('--local', 'Read files from local monorepo (dev only)', false)\n .action(async (componentNames: string[], options) => {\n const cwd = process.cwd()\n const config = loadConfig(cwd)\n\n if (!config) {\n console.log(pc.red('\\n mcp-elements.json not found. Run `npx mcp-elements init` first.\\n'))\n return\n }\n\n // Interactive picker when no args provided\n if (!componentNames || componentNames.length === 0) {\n const allComponents = Object.keys(registry.components)\n const response = await prompts({\n type: 'multiselect',\n name: 'selected',\n message: 'Which components would you like to add?',\n choices: allComponents.map(name => {\n const comp = registry.components[name]\n return {\n title: `${name} ${comp.type === 'css-only' ? pc.dim('(CSS)') : pc.cyan('(interactive)')}`,\n value: name,\n }\n }),\n hint: '- Space to select, Enter to confirm',\n })\n\n if (!response.selected || response.selected.length === 0) {\n console.log(pc.yellow('\\n No components selected.\\n'))\n return\n }\n\n componentNames = response.selected\n }\n\n // Validate component names\n const invalid = componentNames.filter(name => !registry.components[name])\n if (invalid.length > 0) {\n console.log(pc.red(`\\n Unknown components: ${invalid.join(', ')}`))\n console.log(` Run ${pc.cyan('npx mcp-elements list')} to see available components.\\n`)\n return\n }\n\n // Resolve all dependencies\n const allComponents = new Set<string>()\n for (const name of componentNames) {\n const deps = resolveComponentDeps(name)\n for (const dep of deps) {\n allComponents.add(dep)\n }\n allComponents.add(name)\n }\n\n console.log(pc.bold(`\\n Adding ${allComponents.size} component(s):\\n`))\n\n const isLocal = options.local\n\n // Track which coreDeps we've already copied\n const copiedCoreDeps = new Set<string>()\n\n for (const name of allComponents) {\n const component = registry.components[name]\n if (!component) continue\n\n console.log(` ${pc.cyan(name)} ${component.type === 'css-only' ? '(CSS)' : '(interactive)'}`)\n\n const framework = config.framework as 'react' | 'angular' | 'vue'\n const componentDir = path.join(cwd, config.aliases.components)\n await ensureDir(componentDir)\n\n // Get the files to copy for this framework\n const files = component.files[framework]\n const cssFile = component.files.css\n const coreFile = component.files.core\n\n if (!files) {\n console.log(pc.yellow(` Skipped: no ${framework} adapter`))\n continue\n }\n\n // Copy framework-specific files\n const filesToCopy = Array.isArray(files) ? files : [files]\n for (const file of filesToCopy) {\n const fileName = path.basename(file)\n const destPath = path.join(componentDir, fileName)\n\n if (fs.existsSync(destPath) && !options.overwrite) {\n console.log(pc.yellow(` Skipped: ${fileName} (already exists, use --overwrite)`))\n continue\n }\n\n try {\n let content = await fetchFile(file, isLocal)\n content = transformImports(content, config)\n await writeFile(destPath, content)\n console.log(pc.green(` Created: ${config.aliases.components}/${fileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${fileName} — ${(err as Error).message}`))\n }\n }\n\n // Copy core logic file if interactive\n if (coreFile && component.type === 'interactive') {\n const utilsDir = path.join(cwd, config.aliases.utils)\n await ensureDir(utilsDir)\n const coreFileName = path.basename(coreFile)\n const coreDest = path.join(utilsDir, coreFileName)\n\n if (!fs.existsSync(coreDest) || options.overwrite) {\n try {\n const coreContent = await fetchFile(coreFile, isLocal)\n await writeFile(coreDest, coreContent)\n console.log(pc.green(` Created: ${config.aliases.utils}/${coreFileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${coreFileName} — ${(err as Error).message}`))\n }\n }\n\n // Copy coreDeps (dom.ts, keyboard.ts, etc.)\n const coreDeps = resolveCoreDeps(name)\n for (const dep of coreDeps) {\n if (copiedCoreDeps.has(dep)) continue\n copiedCoreDeps.add(dep)\n\n const depFileName = path.basename(dep)\n const depDest = path.join(utilsDir, depFileName)\n\n if (fs.existsSync(depDest) && !options.overwrite) continue\n\n try {\n const depContent = await fetchFile(dep, isLocal)\n await writeFile(depDest, depContent)\n console.log(pc.green(` Created: ${config.aliases.utils}/${depFileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${depFileName} — ${(err as Error).message}`))\n }\n }\n }\n\n // Always copy shared coreDeps (cn.ts) for any component\n if (component.type === 'css-only') {\n const utilsDir = path.join(cwd, config.aliases.utils)\n await ensureDir(utilsDir)\n\n for (const dep of registry.meta.sharedCoreDeps) {\n if (copiedCoreDeps.has(dep)) continue\n copiedCoreDeps.add(dep)\n\n const depFileName = path.basename(dep)\n const depDest = path.join(utilsDir, depFileName)\n\n if (fs.existsSync(depDest) && !options.overwrite) continue\n\n try {\n const depContent = await fetchFile(dep, isLocal)\n await writeFile(depDest, depContent)\n console.log(pc.green(` Created: ${config.aliases.utils}/${depFileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${depFileName} — ${(err as Error).message}`))\n }\n }\n }\n\n // Copy CSS file\n if (cssFile) {\n const cssDir = path.join(cwd, path.dirname(config.tailwind.css))\n const cssComponentsDir = path.join(cssDir, 'components')\n await ensureDir(cssComponentsDir)\n const cssFileName = path.basename(cssFile)\n const cssDest = path.join(cssComponentsDir, cssFileName)\n\n if (!fs.existsSync(cssDest) || options.overwrite) {\n try {\n const cssContent = await fetchFile(cssFile, isLocal)\n await writeFile(cssDest, cssContent)\n console.log(pc.green(` Created: components/${cssFileName}`))\n } catch (err) {\n console.log(pc.red(` Failed: ${cssFileName} — ${(err as Error).message}`))\n }\n }\n\n // Wire the component's CSS into the global stylesheet — otherwise the\n // copied components render unstyled (nothing else imports it).\n const globalCssPath = path.join(cwd, config.tailwind.css)\n const importLine = `@import './components/${cssFileName}';`\n try {\n const existing = fs.existsSync(globalCssPath)\n ? fs.readFileSync(globalCssPath, 'utf-8')\n : ''\n if (!existing.includes(importLine)) {\n fs.writeFileSync(\n globalCssPath,\n existing ? `${importLine}\\n${existing}` : `${importLine}\\n`\n )\n console.log(pc.green(` Linked: ${config.tailwind.css} ← components/${cssFileName}`))\n }\n } catch (err) {\n console.log(\n pc.yellow(` Could not link CSS into ${config.tailwind.css}: ${(err as Error).message}`)\n )\n }\n }\n }\n\n console.log(pc.bold(pc.green('\\n Done!\\n')))\n })\n","import path from 'node:path'\nimport type { SnxConfig } from './detect.js'\n\n// Maps each exported symbol to its source file (relative to utils dir)\nconst SYMBOL_TO_FILE: Record<string, string> = {\n // utils/cn.ts\n cn: 'cn',\n // utils/dom.ts\n trapFocus: 'dom',\n lockScroll: 'dom',\n createClickOutsideHandler: 'dom',\n getFocusableElements: 'dom',\n // utils/keyboard.ts\n Keys: 'keyboard',\n getNextIndex: 'keyboard',\n handleArrowNavigation: 'keyboard',\n KeyboardDirection: 'keyboard',\n // dialog\n createDialog: 'dialog',\n DialogConfig: 'dialog',\n // tabs\n createTabs: 'tabs',\n TabsConfig: 'tabs',\n TabItem: 'tabs',\n // accordion\n createAccordion: 'accordion',\n AccordionConfig: 'accordion',\n AccordionItemConfig: 'accordion',\n // select\n createSelect: 'select',\n SelectConfig: 'select',\n SelectOption: 'select',\n // tooltip\n createTooltip: 'tooltip',\n TooltipConfig: 'tooltip',\n // popover\n createPopover: 'popover',\n PopoverConfig: 'popover',\n // toast\n toast: 'toast',\n createToastManager: 'toast',\n Toast: 'toast',\n ToastConfig: 'toast',\n ToastState: 'toast',\n // drawer\n createDrawer: 'drawer',\n DrawerConfig: 'drawer',\n // dropdown-menu\n createDropdownMenu: 'dropdown-menu',\n DropdownMenuConfig: 'dropdown-menu',\n DropdownMenuItem: 'dropdown-menu',\n // switch\n createSwitch: 'switch',\n SwitchConfig: 'switch',\n // mcp/types.ts\n BaseMetadata: 'types',\n Icons: 'types',\n Implementation: 'types',\n ServerCapabilities: 'types',\n JsonSchema: 'types',\n Tool: 'types',\n Resource: 'types',\n Prompt: 'types',\n ContentBlock: 'types',\n CallToolResult: 'types',\n UiResource: 'types',\n ToolCallStatus: 'types',\n ScopeDescriptor: 'types',\n // mcp/tool-state.ts\n createToolState: 'tool-state',\n ToolStateSnapshot: 'tool-state',\n ToolStateApi: 'tool-state',\n // mcp/scope.ts\n parseScope: 'scope',\n parseScopes: 'scope',\n // mcp/schema-form.ts\n schemaToFields: 'schema-form',\n FieldKind: 'schema-form',\n FieldDescriptor: 'schema-form',\n // mcp/app-bridge.ts\n createAppBridge: 'app-bridge',\n encodeEnvelope: 'app-bridge',\n decodeEnvelope: 'app-bridge',\n AppBridge: 'app-bridge',\n AppBridgeConfig: 'app-bridge',\n AppMessageEnvelope: 'app-bridge',\n // mcp/oauth.ts\n createOAuthFlow: 'oauth',\n buildAuthUrl: 'oauth',\n buildTokenExchangeBody: 'oauth',\n buildTokenRefreshBody: 'oauth',\n OAuthFlowApi: 'oauth',\n OAuthFlowSnapshot: 'oauth',\n OAuthStatus: 'oauth',\n OAuthTokens: 'oauth',\n PkcePair: 'oauth',\n AuthUrlInput: 'oauth',\n TokenExchangeInput: 'oauth',\n TokenRefreshInput: 'oauth',\n}\n\n// Regex to match import statements from @mcp-elements/core\nconst CORE_IMPORT_RE = /import\\s+(type\\s+)?{([^}]+)}\\s+from\\s+['\"]@mcp-elements\\/core['\"]/g\n\nexport function transformImports(content: string, config: SnxConfig): string {\n let result = content\n // Components are copied into `aliases.components` and their core/util deps into\n // `aliases.utils`. Emit a RELATIVE specifier between those two dirs so the\n // import resolves in any project with zero tsconfig `paths`/bundler-alias\n // setup (e.g. `../../lib/utils/cn`). A bare `src/lib/utils/cn` would be\n // treated as a node_modules package and fail to resolve.\n const utilsPath =\n path.posix.relative(config.aliases.components, config.aliases.utils) || '.'\n\n // Collect all @mcp-elements/core imports and replace them\n result = result.replace(CORE_IMPORT_RE, (match, typeKeyword, symbolsStr) => {\n const isTypeOnly = !!typeKeyword\n const symbols = symbolsStr\n .split(',')\n .map((s: string) => s.trim())\n .filter((s: string) => s.length > 0)\n\n // Group symbols by target file\n const groups: Record<string, { symbols: string[]; hasType: boolean }> = {}\n\n for (const sym of symbols) {\n // Handle \"type Foo\" within a value import\n const isInlineType = sym.startsWith('type ')\n const cleanSym = isInlineType ? sym.replace('type ', '') : sym\n const targetFile = SYMBOL_TO_FILE[cleanSym]\n\n if (!targetFile) {\n // Unknown symbol — keep it pointing to cn as fallback\n const file = 'cn'\n if (!groups[file]) groups[file] = { symbols: [], hasType: false }\n groups[file].symbols.push(sym)\n continue\n }\n\n if (!groups[targetFile]) groups[targetFile] = { symbols: [], hasType: false }\n if (isTypeOnly || isInlineType) {\n groups[targetFile].hasType = true\n }\n groups[targetFile].symbols.push(sym)\n }\n\n // Build replacement import statements\n const imports: string[] = []\n for (const [file, group] of Object.entries(groups)) {\n const allType = isTypeOnly || group.symbols.every(s => s.startsWith('type '))\n const keyword = allType ? 'import type' : 'import'\n imports.push(`${keyword} { ${group.symbols.join(', ')} } from '${utilsPath}/${file}'`)\n }\n\n return imports.join('\\n')\n })\n\n // Transform relative hook imports to match component directory\n result = result.replace(\n /from ['\"]\\.\\/hooks\\//g,\n `from './`\n )\n\n // Collapse parent-directory component imports. MCP components live in a\n // `mcp/` subdir and import their base-component deps via `../button` etc.,\n // but the CLI copies every component flat into the same directory. The\n // negative lookahead leaves deeper relative paths (e.g. the `../../lib/utils`\n // util imports emitted above) untouched.\n result = result.replace(/from (['\"])\\.\\.\\/(?!\\.\\.\\/)/g, `from $1./`)\n\n return result\n}\n","import path from 'node:path'\nimport fs from 'node:fs'\nimport { fileURLToPath } from 'node:url'\n\nconst BASE_URL = 'https://raw.githubusercontent.com/mcp-elements/ui/main/packages'\n\n// `__dirname` is undefined in ESM output. Derive it from import.meta.url so\n// `--local` works against the monorepo. The bundle lives in packages/cli/dist,\n// so two levels up is the `packages/` dir that registry paths are relative to.\nconst HERE = path.dirname(fileURLToPath(import.meta.url))\n\nexport async function fetchFile(relativePath: string, local = false): Promise<string> {\n if (local) {\n const localPath = path.join(HERE, '..', '..', relativePath)\n if (!fs.existsSync(localPath)) {\n throw new Error(`Local file not found: ${localPath}`)\n }\n return fs.readFileSync(localPath, 'utf-8')\n }\n\n const url = `${BASE_URL}/${relativePath}`\n const response = await fetch(url)\n\n if (!response.ok) {\n throw new Error(\n `Failed to fetch ${relativePath} (HTTP ${response.status}). ` +\n `Make sure the file exists at ${url}`\n )\n }\n\n return response.text()\n}\n","import { Command } from 'commander'\nimport pc from 'picocolors'\nimport path from 'node:path'\nimport { loadConfig } from '../utils/detect.js'\nimport { writeFile, ensureDir } from '../utils/fs.js'\nimport { fetchFile } from '../utils/fetch.js'\n\nexport const themeCommand = new Command('theme')\n .description('Manage themes')\n .argument('<theme>', 'Theme to add (dark, glass)')\n .option('--local', 'Read files from local monorepo (dev only)', false)\n .action(async (theme: string, options) => {\n const cwd = process.cwd()\n const config = loadConfig(cwd)\n\n if (!config) {\n console.log(pc.red('\\n mcp-elements.json not found. Run `npx mcp-elements init` first.\\n'))\n return\n }\n\n if (theme === 'dark') {\n console.log(pc.bold('\\n Dark theme\\n'))\n console.log(' Dark theme tokens are already included in your base CSS.')\n console.log(' To activate dark mode, add this to your HTML:')\n console.log(pc.cyan('\\n <html data-theme=\"dark\">'))\n console.log('\\n Or toggle with JavaScript:')\n console.log(pc.cyan(\" document.documentElement.setAttribute('data-theme', 'dark')\"))\n console.log()\n } else if (theme === 'glass') {\n console.log(pc.bold('\\n Glass theme\\n'))\n\n try {\n const glassContent = await fetchFile('css/themes/glass.css', options.local)\n const cssDir = path.join(cwd, path.dirname(config.tailwind.css))\n await ensureDir(cssDir)\n const destPath = path.join(cssDir, 'glass.css')\n await writeFile(destPath, glassContent)\n\n console.log(pc.green(` Created: ${path.relative(cwd, destPath)}`))\n console.log('\\n Import it in your main CSS file:')\n console.log(pc.cyan(`\\n @import './glass.css';`))\n console.log('\\n Then activate by adding to your HTML:')\n console.log(pc.cyan('\\n <html data-theme=\"glass\">'))\n console.log('\\n Or toggle with JavaScript:')\n console.log(pc.cyan(\" document.documentElement.setAttribute('data-theme', 'glass')\"))\n console.log()\n } catch (err) {\n console.log(pc.red(` Failed to fetch glass theme: ${(err as Error).message}\\n`))\n }\n } else {\n console.log(pc.yellow(`\\n Theme \"${theme}\" is not available.`))\n console.log(`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AS,OAAO,CAAC,SAAS;AACzC,UAAM,OAAOA,UAAS,WAAW,IAAI;AACrC,WACG,KAA+B,aAAa,UAC3C,KAA6B,QAAQ,CAAC,GAAG,SAAS,KAAK,KACzD,KAAK,WAAW,MAAM;AAAA,EAE1B,CAAC;AACD,QAAM,aAAa,SAAS,OAAO,CAAC,SAAS,CAAC,SAAS,SAAS,IAAI,CAAC;AAErE,WAAS,WAAW,OAAiB;AACnC,eAAW,QAAQ,OAAO;AACxB,YAAM,OAAOA,UAAS,WAAW,IAAI;AACrC,YAAM,OAAO,KAAK,SAAS,aAAaD,IAAG,IAAI,YAAY,IAAIA,IAAG,KAAK,eAAe;AACtF,cAAQ,IAAI,KAAKA,IAAG,KAAK,IAAI,CAAC,IAAI,IAAI,EAAE;AAAA,IAC1C;AAAA,EACF;AAEA,MAAI,SAAS,SAAS,GAAG;AACvB,YAAQ,IAAI,OAAOA,IAAG,KAAKA,IAAG,QAAQ,YAAY,CAAC,IAAI,IAAI;AAC3D,eAAW,QAAQ;AAAA,EACrB;AAEA,MAAI,WAAW,SAAS,GAAG;AACzB,YAAQ,IAAI,OAAOA,IAAG,KAAK,QAAQ,IAAIA,IAAG,IAAI,4BAAuB,IAAI,IAAI;AAC7E,eAAW,UAAU;AAAA,EACvB;AAEA,UAAQ,IAAI;AAAA,SAAY,SAAS,MAAM,aAAa,SAAS,WAAW,IAAI,MAAM,EAAE,EAAE;AACtF,MAAI,SAAS,SAAS,GAAG;AACvB,YAAQ,IAAIA,IAAG,IAAI,KAAK,SAAS,MAAM,sBAAmB,WAAW,MAAM,SAAS,CAAC;AAAA,EACvF;AACA,UAAQ,IAAI;AACd,CAAC;AAEH,QAAQ,MAAM;","names":["Command","fs","path","path","fs","Command","pc","path","fs","prompts","path","path","fs","Command","pc","allComponents","prompts","path","fs","Command","pc","path","Command","pc","path","Command","pc","registry"]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
registry,
|
|
6
6
|
resolveComponentDeps,
|
|
7
7
|
resolveCoreDeps
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WT4KIDWW.js";
|
|
9
9
|
export {
|
|
10
10
|
getComponent,
|
|
11
11
|
listComponents,
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
resolveComponentDeps,
|
|
14
14
|
resolveCoreDeps
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=resolve-
|
|
16
|
+
//# sourceMappingURL=resolve-3LDLIADF.js.map
|
package/package.json
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-elements",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mcp-elements": "./dist/index.js"
|
|
7
7
|
},
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "tsup",
|
|
10
|
-
"dev": "tsup --watch",
|
|
11
|
-
"test": "vitest run --passWithNoTests",
|
|
12
|
-
"test:watch": "vitest",
|
|
13
|
-
"clean": "rm -rf dist"
|
|
14
|
-
},
|
|
15
8
|
"dependencies": {
|
|
16
9
|
"commander": "^12.1.0",
|
|
17
10
|
"prompts": "^2.4.2",
|
|
@@ -24,5 +17,12 @@
|
|
|
24
17
|
},
|
|
25
18
|
"files": [
|
|
26
19
|
"dist"
|
|
27
|
-
]
|
|
28
|
-
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup",
|
|
23
|
+
"dev": "tsup --watch",
|
|
24
|
+
"test": "vitest run --passWithNoTests",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"clean": "rm -rf dist"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/registry/registry.json","../src/registry/resolve.ts"],"sourcesContent":["{\n \"meta\": {\n \"baseUrl\": \"https://raw.githubusercontent.com/mcp-elements/ui/main/packages\",\n \"sharedCoreDeps\": [\"core/src/utils/cn.ts\"]\n },\n \"components\": {\n \"button\": {\n \"name\": \"button\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/button.css\",\n \"react\": \"react/src/button.tsx\",\n \"angular\": \"angular/src/button.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"badge\": {\n \"name\": \"badge\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/badge.css\",\n \"react\": \"react/src/badge.tsx\",\n \"angular\": \"angular/src/badge.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"card\": {\n \"name\": \"card\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/card.css\",\n \"react\": \"react/src/card.tsx\",\n \"angular\": \"angular/src/card.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"input\": {\n \"name\": \"input\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/input.css\",\n \"react\": \"react/src/input.tsx\",\n \"angular\": \"angular/src/input.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"textarea\": {\n \"name\": \"textarea\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/textarea.css\",\n \"react\": \"react/src/textarea.tsx\",\n \"angular\": \"angular/src/textarea.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"avatar\": {\n \"name\": \"avatar\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/avatar.css\",\n \"react\": \"react/src/avatar.tsx\",\n \"angular\": \"angular/src/avatar.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"separator\": {\n \"name\": \"separator\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/separator.css\",\n \"react\": \"react/src/separator.tsx\",\n \"angular\": \"angular/src/separator.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"skeleton\": {\n \"name\": \"skeleton\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/skeleton.css\",\n \"react\": \"react/src/skeleton.tsx\",\n \"angular\": \"angular/src/skeleton.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"dialog\": {\n \"name\": \"dialog\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/dialog.css\",\n \"core\": \"core/src/dialog.ts\",\n \"react\": [\"react/src/dialog.tsx\", \"react/src/hooks/use-dialog.ts\"],\n \"angular\": \"angular/src/dialog.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\"],\n \"dependencies\": { \"internal\": [\"button\"], \"npm\": {} }\n },\n \"tabs\": {\n \"name\": \"tabs\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/tabs.css\",\n \"core\": \"core/src/tabs.ts\",\n \"react\": [\"react/src/tabs.tsx\", \"react/src/hooks/use-tabs.ts\"],\n \"angular\": \"angular/src/tabs.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/keyboard.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"accordion\": {\n \"name\": \"accordion\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/accordion.css\",\n \"core\": \"core/src/accordion.ts\",\n \"react\": [\"react/src/accordion.tsx\", \"react/src/hooks/use-accordion.ts\"],\n \"angular\": \"angular/src/accordion.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/keyboard.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"select\": {\n \"name\": \"select\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/select.css\",\n \"core\": \"core/src/select.ts\",\n \"react\": [\"react/src/select.tsx\", \"react/src/hooks/use-select.ts\"],\n \"angular\": \"angular/src/select.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\", \"core/src/utils/keyboard.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"tooltip\": {\n \"name\": \"tooltip\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/tooltip.css\",\n \"core\": \"core/src/tooltip.ts\",\n \"react\": [\"react/src/tooltip.tsx\", \"react/src/hooks/use-tooltip.ts\"],\n \"angular\": \"angular/src/tooltip.directive.ts\"\n },\n \"coreDeps\": [],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"popover\": {\n \"name\": \"popover\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/popover.css\",\n \"core\": \"core/src/popover.ts\",\n \"react\": [\"react/src/popover.tsx\", \"react/src/hooks/use-popover.ts\"],\n \"angular\": \"angular/src/popover.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"toast\": {\n \"name\": \"toast\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/toast.css\",\n \"core\": \"core/src/toast.ts\",\n \"react\": [\"react/src/toast.tsx\", \"react/src/hooks/use-toast.ts\"],\n \"angular\": \"angular/src/toast.component.ts\"\n },\n \"coreDeps\": [],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"drawer\": {\n \"name\": \"drawer\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/drawer.css\",\n \"core\": \"core/src/drawer.ts\",\n \"react\": [\"react/src/drawer.tsx\", \"react/src/hooks/use-drawer.ts\"],\n \"angular\": \"angular/src/drawer.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"dropdown-menu\": {\n \"name\": \"dropdown-menu\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/dropdown-menu.css\",\n \"core\": \"core/src/dropdown-menu.ts\",\n \"react\": [\"react/src/dropdown-menu.tsx\", \"react/src/hooks/use-dropdown-menu.ts\"],\n \"angular\": \"angular/src/dropdown-menu.component.ts\"\n },\n \"coreDeps\": [\"core/src/utils/dom.ts\", \"core/src/utils/keyboard.ts\"],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"switch\": {\n \"name\": \"switch\",\n \"type\": \"interactive\",\n \"files\": {\n \"css\": \"css/components/switch.css\",\n \"core\": \"core/src/switch.ts\",\n \"react\": \"react/src/switch.tsx\",\n \"angular\": \"angular/src/switch.component.ts\"\n },\n \"coreDeps\": [],\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"progress\": {\n \"name\": \"progress\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/progress.css\",\n \"react\": \"react/src/progress.tsx\",\n \"angular\": \"angular/src/progress.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"loader\": {\n \"name\": \"loader\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/loader.css\",\n \"react\": \"react/src/loader.tsx\",\n \"angular\": \"angular/src/loader.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"chips\": {\n \"name\": \"chips\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/chips.css\",\n \"react\": \"react/src/chips.tsx\",\n \"angular\": \"angular/src/chips.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"password-input\": {\n \"name\": \"password-input\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/password-input.css\",\n \"react\": \"react/src/password-input.tsx\",\n \"angular\": \"angular/src/password-input.component.ts\"\n },\n \"dependencies\": { \"internal\": [\"input\"], \"npm\": {} }\n },\n \"counter\": {\n \"name\": \"counter\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/counter.css\",\n \"react\": \"react/src/counter.tsx\",\n \"angular\": \"angular/src/counter.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"alert\": {\n \"name\": \"alert\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/alert.css\",\n \"react\": \"react/src/alert.tsx\",\n \"angular\": \"angular/src/alert.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"prompt-input\": {\n \"name\": \"prompt-input\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/prompt-input.css\",\n \"react\": \"react/src/prompt-input.tsx\",\n \"angular\": \"angular/src/prompt-input.component.ts\"\n },\n \"dependencies\": { \"internal\": [\"button\"], \"npm\": {} }\n },\n \"chat-bubble\": {\n \"name\": \"chat-bubble\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/chat-bubble.css\",\n \"react\": \"react/src/chat-bubble.tsx\",\n \"angular\": \"angular/src/chat-bubble.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"ai-badge\": {\n \"name\": \"ai-badge\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/ai-badge.css\",\n \"react\": \"react/src/ai-badge.tsx\",\n \"angular\": \"angular/src/ai-badge.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"suggestion-chips\": {\n \"name\": \"suggestion-chips\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/suggestion-chips.css\",\n \"react\": \"react/src/suggestion-chips.tsx\",\n \"angular\": \"angular/src/suggestion-chips.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"source-card\": {\n \"name\": \"source-card\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/source-card.css\",\n \"react\": \"react/src/source-card.tsx\",\n \"angular\": \"angular/src/source-card.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"streaming-text\": {\n \"name\": \"streaming-text\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/streaming-text.css\",\n \"react\": \"react/src/streaming-text.tsx\",\n \"angular\": \"angular/src/streaming-text.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n },\n \"feedback\": {\n \"name\": \"feedback\",\n \"type\": \"css-only\",\n \"files\": {\n \"css\": \"css/components/feedback.css\",\n \"react\": \"react/src/feedback.tsx\",\n \"angular\": \"angular/src/feedback.component.ts\"\n },\n \"dependencies\": { \"internal\": [], \"npm\": {} }\n }\n }\n}\n","import registryData from './registry.json' with { type: 'json' }\n\nexport interface ComponentEntry {\n name: string\n type: 'css-only' | 'interactive'\n files: {\n css?: string\n core?: string\n react?: string | string[]\n angular?: string | string[]\n }\n coreDeps?: string[]\n dependencies: {\n internal: string[]\n npm: Record<string, string[]>\n }\n}\n\nexport interface RegistryMeta {\n baseUrl: string\n sharedCoreDeps: string[]\n}\n\nexport interface Registry {\n meta: RegistryMeta\n components: Record<string, ComponentEntry>\n}\n\nexport const registry = registryData as unknown as Registry\n\nexport function resolveComponentDeps(name: string, resolved = new Set<string>()): string[] {\n const component = registry.components[name]\n if (!component) return []\n\n for (const dep of component.dependencies.internal) {\n if (!resolved.has(dep)) {\n resolved.add(dep)\n resolveComponentDeps(dep, resolved)\n }\n }\n\n return Array.from(resolved)\n}\n\nexport function resolveCoreDeps(name: string): string[] {\n const component = registry.components[name]\n if (!component) return []\n\n const deps = new Set<string>(registry.meta.sharedCoreDeps)\n\n if (component.coreDeps) {\n for (const dep of component.coreDeps) {\n deps.add(dep)\n }\n }\n\n return Array.from(deps)\n}\n\nexport function getComponent(name: string): ComponentEntry | undefined {\n return registry.components[name]\n}\n\nexport function listComponents(): string[] {\n return Object.keys(registry.components)\n}\n"],"mappings":";;;AAAA;AAAA,EACE,MAAQ;AAAA,IACN,SAAW;AAAA,IACX,gBAAkB,CAAC,sBAAsB;AAAA,EAC3C;AAAA,EACA,YAAc;AAAA,IACZ,QAAU;AAAA,MACR,MAAQ;AAAA,MACR,MAAQ;AAAA,MACR,OAAS;AAAA,QACP,KAAO;AAAA,QACP,OAAS;AAAA,QACT,SAAW;AAA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