@hanzo/ui 4.6.0 → 4.8.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/assets/general.tsx +1 -1
- package/assets/hanzo-logo.tsx +3 -1
- package/assets/index.ts +119 -5
- package/blocks/auth/index.ts +6 -0
- package/blocks/auth/login-2fa.tsx +165 -0
- package/blocks/auth/login-basic.tsx +94 -0
- package/blocks/auth/login-social.tsx +148 -0
- package/blocks/auth/magic-link.tsx +129 -0
- package/blocks/auth/password-reset.tsx +97 -0
- package/blocks/auth/signup.tsx +157 -0
- package/blocks/data-display/activity-feed.tsx +242 -0
- package/blocks/data-display/data-table.tsx +235 -0
- package/blocks/data-display/stats-grid.tsx +194 -0
- package/blocks/ecommerce/checkout.tsx +242 -0
- package/blocks/ecommerce/index.ts +7 -0
- package/blocks/ecommerce/product-detail.tsx +257 -0
- package/blocks/ecommerce/product-grid.tsx +148 -0
- package/blocks/ecommerce/shopping-cart.tsx +181 -0
- package/blocks/marketing/cta-section.tsx +207 -0
- package/blocks/marketing/faq.tsx +159 -0
- package/blocks/marketing/features-grid.tsx +156 -0
- package/blocks/marketing/hero-section.tsx +192 -0
- package/blocks/marketing/index.ts +6 -0
- package/blocks/marketing/pricing-table.tsx +121 -0
- package/blocks/marketing/testimonials.tsx +196 -0
- package/components/index.ts +4 -51
- package/dist/index.js +9351 -0
- package/dist/index.mjs +9340 -0
- package/dist/lib/utils.js +47 -0
- package/dist/lib/utils.mjs +28 -0
- package/dist/src/utils.js +47 -0
- package/dist/src/utils.mjs +28 -0
- package/dist/tailwind/index.js +2050 -0
- package/dist/tailwind/index.mjs +2019 -0
- package/dist/types/index.js +79 -0
- package/dist/types/index.mjs +56 -0
- package/dist/util/format-text.js +51 -0
- package/dist/util/format-text.mjs +32 -0
- package/dist/util/index.js +384 -0
- package/dist/util/index.mjs +363 -0
- package/frameworks/core/index.ts +6 -0
- package/frameworks/core/utils/index.ts +64 -0
- package/frameworks/react/components/button.tsx +26 -0
- package/frameworks/react/components/index.ts +5 -0
- package/frameworks/react/hooks/index.ts +5 -0
- package/frameworks/react/index.ts +9 -0
- package/frameworks/react/package.json +8 -0
- package/frameworks/react/utils/index.ts +2 -0
- package/frameworks/react-native/index.ts +9 -0
- package/frameworks/react-native/package.json +8 -0
- package/frameworks/registry.json +371 -0
- package/frameworks/setup.sh +69 -0
- package/frameworks/svelte/index.ts +9 -0
- package/frameworks/svelte/package.json +8 -0
- package/frameworks/tracker.json +1854 -0
- package/frameworks/vue/index.ts +9 -0
- package/frameworks/vue/package.json +8 -0
- package/package.json +192 -28
- package/primitives/accordion.tsx +1 -1
- package/primitives/alert-dialog.tsx +1 -1
- package/primitives/alert.tsx +1 -1
- package/primitives/avatar.tsx +1 -1
- package/primitives/badge.tsx +2 -1
- package/primitives/breadcrumb.tsx +1 -1
- package/primitives/button.tsx +37 -47
- package/primitives/card.tsx +1 -1
- package/primitives/carousel.tsx +3 -2
- package/primitives/chat/chat-input-area.tsx +5 -4
- package/primitives/chat/chat-input.tsx +2 -2
- package/primitives/chat/files-preview.tsx +5 -4
- package/primitives/chat/message-list.tsx +2 -1
- package/primitives/chat/sqlite-preview.tsx +8 -8
- package/primitives/checkbox.tsx +2 -1
- package/primitives/command.tsx +3 -1
- package/primitives/context-menu.tsx +1 -1
- package/primitives/dialog.tsx +6 -1
- package/primitives/drawer.tsx +4 -1
- package/primitives/dropdown-menu.tsx +1 -1
- package/primitives/file-uploader.tsx +4 -2
- package/primitives/form.tsx +1 -1
- package/primitives/hover-card.tsx +1 -1
- package/primitives/icons/github.tsx +2 -2
- package/primitives/icons/youtube-logo.tsx +1 -1
- package/primitives/index-common.ts +7 -6
- package/primitives/input-otp.tsx +1 -1
- package/primitives/input.tsx +2 -1
- package/primitives/label.tsx +2 -1
- package/primitives/markdown-preview.tsx +3 -0
- package/primitives/mermaid.tsx +13 -18
- package/primitives/next/image.tsx +2 -1
- package/primitives/next/inline-icon.tsx +14 -14
- package/primitives/next/media-stack.tsx +2 -19
- package/primitives/pagination.tsx +1 -1
- package/primitives/popover.tsx +4 -2
- package/primitives/progress.tsx +2 -1
- package/primitives/prompt-textarea.tsx +1 -1
- package/primitives/radio-group.tsx +1 -1
- package/primitives/scroll-area.tsx +1 -1
- package/primitives/search-input.tsx +1 -1
- package/primitives/select.tsx +1 -1
- package/primitives/separator.tsx +2 -1
- package/primitives/sheet.tsx +1 -1
- package/primitives/skeleton.tsx +1 -0
- package/primitives/slider.tsx +2 -1
- package/primitives/stepper.tsx +1 -1
- package/primitives/switch.tsx +2 -1
- package/primitives/table.tsx +1 -1
- package/primitives/tabs.tsx +1 -1
- package/primitives/textarea.tsx +2 -1
- package/primitives/textfield.tsx +1 -0
- package/primitives/toggle-group.tsx +1 -1
- package/primitives/toggle.tsx +1 -1
- package/primitives/tooltip.tsx +1 -1
- package/src/hooks/use-copy-clipboard.ts +1 -1
- package/src/index-lean.ts +87 -0
- package/src/index.ts +54 -0
- package/src/registry/api.ts +1 -1
- package/src/utils.ts +19 -1
- package/tailwind/tailwind.config.hanzo-preset.js +7 -7
- package/tailwind/typo-plugin/index.js +1 -1
- package/types/animation-def.ts +1 -1
- package/types/index.ts +2 -1
- package/util/blob.ts +9 -4
- package/util/date.ts +2 -1
- package/util/format-text.ts +2 -1
- package/util/index.ts +103 -0
- package/util/spread-to-transform.ts +9 -8
- package/MCP-INSTRUCTIONS.md +0 -73
- package/README-MCP.md +0 -175
- package/dist/button.d.ts +0 -1
- package/dist/button.js +0 -1
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/index.js +0 -7
- package/dist/hooks/use-click-away.d.ts +0 -2
- package/dist/hooks/use-click-away.js +0 -23
- package/dist/hooks/use-combined-refs.d.ts +0 -3
- package/dist/hooks/use-combined-refs.js +0 -18
- package/dist/hooks/use-copy-clipboard.d.ts +0 -9
- package/dist/hooks/use-copy-clipboard.js +0 -21
- package/dist/hooks/use-debounce.d.ts +0 -1
- package/dist/hooks/use-debounce.js +0 -13
- package/dist/hooks/use-fill-ids.d.ts +0 -8
- package/dist/hooks/use-fill-ids.js +0 -20
- package/dist/hooks/use-map.d.ts +0 -1
- package/dist/hooks/use-map.js +0 -20
- package/dist/hooks/use-measure.d.ts +0 -8
- package/dist/hooks/use-measure.js +0 -25
- package/dist/hooks/use-reverse-video-playback.d.ts +0 -1
- package/dist/hooks/use-reverse-video-playback.js +0 -41
- package/dist/hooks/use-scroll-restoration.d.ts +0 -8
- package/dist/hooks/use-scroll-restoration.js +0 -36
- package/dist/mcp/enhanced-server.d.ts +0 -29
- package/dist/mcp/enhanced-server.js +0 -1128
- package/dist/mcp/index.d.ts +0 -28
- package/dist/mcp/index.js +0 -436
- package/dist/registry/api.d.ts +0 -37
- package/dist/registry/api.js +0 -129
- package/dist/registry/index.d.ts +0 -353
- package/dist/registry/index.js +0 -45
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -1
- package/environment.d.ts +0 -6
- package/public/r/accordion.json +0 -11
- package/public/r/alert.json +0 -11
- package/public/r/avatar.json +0 -11
- package/public/r/badge.json +0 -11
- package/public/r/button.json +0 -11
- package/public/r/card.json +0 -11
- package/public/r/checkbox.json +0 -11
- package/public/r/default.json +0 -6
- package/public/r/dialog.json +0 -11
- package/public/r/input.json +0 -11
- package/public/r/label.json +0 -11
- package/public/r/new-york.json +0 -6
- package/public/r/popover.json +0 -11
- package/public/r/select.json +0 -11
- package/public/r/table.json +0 -11
- package/public/r/tabs.json +0 -11
- package/public/r/toast.json +0 -11
- package/registry.json +0 -184
- package/test/test-registry.js +0 -73
- package/test-imports.mjs +0 -19
- package/tsconfig.json +0 -22
- package/utils.ts +0 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.8.2",
|
|
4
|
+
"description": "Multi-framework UI library with React, Vue, Svelte, and React Native support. Based on shadcn/ui with comprehensive framework coverage.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
7
7
|
"access": "public",
|
|
@@ -9,6 +9,27 @@
|
|
|
9
9
|
},
|
|
10
10
|
"author": "Hanzo AI, Inc.",
|
|
11
11
|
"license": "BSD-3-Clause",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"style",
|
|
19
|
+
"bin",
|
|
20
|
+
"primitives",
|
|
21
|
+
"blocks",
|
|
22
|
+
"components",
|
|
23
|
+
"assets",
|
|
24
|
+
"frameworks",
|
|
25
|
+
"helpers",
|
|
26
|
+
"types",
|
|
27
|
+
"util",
|
|
28
|
+
"src",
|
|
29
|
+
"tailwind",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE"
|
|
32
|
+
],
|
|
12
33
|
"repository": {
|
|
13
34
|
"type": "git",
|
|
14
35
|
"url": "git+https://github.com/hanzoai/react-sdk.git",
|
|
@@ -31,11 +52,21 @@
|
|
|
31
52
|
"scripts": {
|
|
32
53
|
"lat": "npm show @hanzo/ui version",
|
|
33
54
|
"pub": "npm publish",
|
|
34
|
-
"tc": "tsc",
|
|
35
|
-
"build": "
|
|
55
|
+
"tc": "tsc --project tsconfig.build.json",
|
|
56
|
+
"build": "npm run clean && npm run build:tsup",
|
|
57
|
+
"build:tsup": "tsup --config tsup.config.minimal.ts",
|
|
58
|
+
"build:full": "tsup --config tsup.config.production.ts",
|
|
59
|
+
"build:frameworks": "npm run build",
|
|
60
|
+
"build:watch": "tsup --watch",
|
|
61
|
+
"build:check": "tsc --project tsconfig.build.json --noEmit",
|
|
62
|
+
"clean": "rm -rf dist",
|
|
63
|
+
"prepublishOnly": "npm run build",
|
|
36
64
|
"update-registry": "node ./bin/update-registry.js",
|
|
37
65
|
"registry:mcp": "node ./bin/cli.js registry:mcp",
|
|
38
|
-
"registry:mcp:http": "node ./bin/cli.js registry:mcp --http"
|
|
66
|
+
"registry:mcp:http": "node ./bin/cli.js registry:mcp --http",
|
|
67
|
+
"analyze:frameworks": "node analyze-frameworks.js",
|
|
68
|
+
"test": "jest test/multi-framework.test.js",
|
|
69
|
+
"test:frameworks": "jest test/multi-framework.test.js --verbose"
|
|
39
70
|
},
|
|
40
71
|
"bin": {
|
|
41
72
|
"@hanzo/ui": "./bin/cli.js",
|
|
@@ -43,30 +74,154 @@
|
|
|
43
74
|
},
|
|
44
75
|
"exports": {
|
|
45
76
|
".": {
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
},
|
|
50
|
-
"./assets":
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
77
|
+
"types": "./dist/index.d.ts",
|
|
78
|
+
"import": "./dist/index.mjs",
|
|
79
|
+
"require": "./dist/index.js"
|
|
80
|
+
},
|
|
81
|
+
"./assets": {
|
|
82
|
+
"types": "./assets/index.ts",
|
|
83
|
+
"import": "./assets/index.ts",
|
|
84
|
+
"require": "./assets/index.ts"
|
|
85
|
+
},
|
|
86
|
+
"./helpers": {
|
|
87
|
+
"types": "./helpers/index.ts",
|
|
88
|
+
"import": "./helpers/index.ts",
|
|
89
|
+
"require": "./helpers/index.ts"
|
|
90
|
+
},
|
|
91
|
+
"./blocks": {
|
|
92
|
+
"types": "./dist/blocks/index.d.ts",
|
|
93
|
+
"import": "./dist/blocks/index.mjs",
|
|
94
|
+
"require": "./dist/blocks/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./blocks/*": {
|
|
97
|
+
"types": "./dist/blocks/*.d.ts",
|
|
98
|
+
"import": "./dist/blocks/*.mjs",
|
|
99
|
+
"require": "./dist/blocks/*.js"
|
|
100
|
+
},
|
|
101
|
+
"./components": {
|
|
102
|
+
"types": "./dist/components/index.d.ts",
|
|
103
|
+
"import": "./dist/components/index.mjs",
|
|
104
|
+
"require": "./dist/components/index.js"
|
|
105
|
+
},
|
|
106
|
+
"./components/*": {
|
|
107
|
+
"types": "./dist/components/*.d.ts",
|
|
108
|
+
"import": "./dist/components/*.mjs",
|
|
109
|
+
"require": "./dist/components/*.js"
|
|
110
|
+
},
|
|
111
|
+
"./primitives": {
|
|
112
|
+
"types": "./dist/primitives/index-next.d.ts",
|
|
113
|
+
"import": "./dist/primitives/index-next.mjs",
|
|
114
|
+
"require": "./dist/primitives/index-next.js"
|
|
115
|
+
},
|
|
116
|
+
"./primitives/*": {
|
|
117
|
+
"types": "./dist/primitives/*.d.ts",
|
|
118
|
+
"import": "./dist/primitives/*.mjs",
|
|
119
|
+
"require": "./dist/primitives/*.js"
|
|
120
|
+
},
|
|
121
|
+
"./primitives-common": {
|
|
122
|
+
"types": "./dist/primitives/index-common.d.ts",
|
|
123
|
+
"import": "./dist/primitives/index-common.mjs",
|
|
124
|
+
"require": "./dist/primitives/index-common.js"
|
|
125
|
+
},
|
|
55
126
|
"./registry": {
|
|
56
|
-
"types": "./dist/registry/index.d.ts",
|
|
57
|
-
"
|
|
127
|
+
"types": "./dist/src/registry/index.d.ts",
|
|
128
|
+
"import": "./dist/src/registry/index.mjs",
|
|
129
|
+
"require": "./dist/src/registry/index.js"
|
|
58
130
|
},
|
|
131
|
+
"./hooks": {
|
|
132
|
+
"types": "./dist/src/hooks/index.d.ts",
|
|
133
|
+
"import": "./dist/src/hooks/index.mjs",
|
|
134
|
+
"require": "./dist/src/hooks/index.js"
|
|
135
|
+
},
|
|
136
|
+
"./style": "./style",
|
|
59
137
|
"./style/*": "./style/*",
|
|
60
|
-
"./tailwind":
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"./
|
|
138
|
+
"./tailwind": {
|
|
139
|
+
"types": "./dist/tailwind/index.d.ts",
|
|
140
|
+
"import": "./dist/tailwind/index.mjs",
|
|
141
|
+
"require": "./dist/tailwind/index.js"
|
|
142
|
+
},
|
|
143
|
+
"./tailwind/*": {
|
|
144
|
+
"types": "./dist/tailwind/*.d.ts",
|
|
145
|
+
"import": "./dist/tailwind/*.mjs",
|
|
146
|
+
"require": "./dist/tailwind/*.js"
|
|
147
|
+
},
|
|
148
|
+
"./tailwind/config": {
|
|
149
|
+
"types": "./dist/tailwind/tailwind.config.hanzo-preset.d.ts",
|
|
150
|
+
"import": "./tailwind/tailwind.config.hanzo-preset.js",
|
|
151
|
+
"require": "./tailwind/tailwind.config.hanzo-preset.js"
|
|
152
|
+
},
|
|
153
|
+
"./types": {
|
|
154
|
+
"types": "./dist/types/index.d.ts",
|
|
155
|
+
"import": "./dist/types/index.mjs",
|
|
156
|
+
"require": "./dist/types/index.js"
|
|
157
|
+
},
|
|
158
|
+
"./types/*": {
|
|
159
|
+
"types": "./dist/types/*.d.ts",
|
|
160
|
+
"import": "./dist/types/*.mjs",
|
|
161
|
+
"require": "./dist/types/*.js"
|
|
162
|
+
},
|
|
163
|
+
"./util": {
|
|
164
|
+
"types": "./dist/util/index.d.ts",
|
|
165
|
+
"import": "./dist/util/index.mjs",
|
|
166
|
+
"require": "./dist/util/index.js"
|
|
167
|
+
},
|
|
168
|
+
"./util/*": {
|
|
169
|
+
"types": "./dist/util/*.d.ts",
|
|
170
|
+
"import": "./dist/util/*.mjs",
|
|
171
|
+
"require": "./dist/util/*.js"
|
|
172
|
+
},
|
|
173
|
+
"./util/format-text": {
|
|
174
|
+
"types": "./dist/util/format-text.d.ts",
|
|
175
|
+
"import": "./dist/util/format-text.mjs",
|
|
176
|
+
"require": "./dist/util/format-text.js"
|
|
177
|
+
},
|
|
178
|
+
"./util-client": {
|
|
179
|
+
"types": "./dist/util/index-client.d.ts",
|
|
180
|
+
"import": "./dist/util/index-client.mjs",
|
|
181
|
+
"require": "./dist/util/index-client.js"
|
|
182
|
+
},
|
|
183
|
+
"./utils": {
|
|
184
|
+
"types": "./dist/src/utils.d.ts",
|
|
185
|
+
"import": "./dist/src/utils.mjs",
|
|
186
|
+
"require": "./dist/src/utils.js"
|
|
187
|
+
},
|
|
188
|
+
"./lib/utils": {
|
|
189
|
+
"types": "./dist/src/utils.d.ts",
|
|
190
|
+
"import": "./dist/src/utils.mjs",
|
|
191
|
+
"require": "./dist/src/utils.js"
|
|
192
|
+
},
|
|
66
193
|
"./mcp": {
|
|
67
|
-
"types": "./dist/mcp/index.d.ts",
|
|
68
|
-
"
|
|
69
|
-
|
|
194
|
+
"types": "./dist/src/mcp/index.d.ts",
|
|
195
|
+
"import": "./dist/src/mcp/index.mjs",
|
|
196
|
+
"require": "./dist/src/mcp/index.js"
|
|
197
|
+
},
|
|
198
|
+
"./theme-provider": {
|
|
199
|
+
"types": "./dist/style/theme-provider.d.ts",
|
|
200
|
+
"import": "./dist/style/theme-provider.mjs",
|
|
201
|
+
"require": "./dist/style/theme-provider.js"
|
|
202
|
+
},
|
|
203
|
+
"./react": {
|
|
204
|
+
"types": "./dist/frameworks/react/index.d.ts",
|
|
205
|
+
"import": "./dist/frameworks/react/index.mjs",
|
|
206
|
+
"require": "./dist/frameworks/react/index.js"
|
|
207
|
+
},
|
|
208
|
+
"./vue": {
|
|
209
|
+
"types": "./dist/frameworks/vue/index.d.ts",
|
|
210
|
+
"import": "./dist/frameworks/vue/index.mjs",
|
|
211
|
+
"require": "./dist/frameworks/vue/index.js"
|
|
212
|
+
},
|
|
213
|
+
"./svelte": {
|
|
214
|
+
"svelte": "./frameworks/svelte/index.ts",
|
|
215
|
+
"types": "./dist/frameworks/svelte/index.d.ts",
|
|
216
|
+
"import": "./dist/frameworks/svelte/index.mjs",
|
|
217
|
+
"require": "./dist/frameworks/svelte/index.js"
|
|
218
|
+
},
|
|
219
|
+
"./react-native": {
|
|
220
|
+
"types": "./dist/frameworks/react-native/index.d.ts",
|
|
221
|
+
"import": "./dist/frameworks/react-native/index.mjs",
|
|
222
|
+
"require": "./dist/frameworks/react-native/index.js"
|
|
223
|
+
},
|
|
224
|
+
"./package.json": "./package.json"
|
|
70
225
|
},
|
|
71
226
|
"dependencies": {
|
|
72
227
|
"@hanzo/react-drawer": "^0.1.8",
|
|
@@ -100,26 +255,33 @@
|
|
|
100
255
|
"@radix-ui/react-toggle-group": "^1.0.4",
|
|
101
256
|
"@radix-ui/react-tooltip": "^1.0.6",
|
|
102
257
|
"@radix-ui/react-use-callback-ref": "^1.1.1",
|
|
103
|
-
"@splinetool/react-spline": "^4.0.0",
|
|
104
|
-
"@splinetool/runtime": "^1.9.35",
|
|
105
258
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
106
259
|
"class-variance-authority": "^0.7.1",
|
|
107
260
|
"clsx": "^2.1.1",
|
|
108
261
|
"cmdk": "^0.2.0",
|
|
109
262
|
"commander": "^12.1.0",
|
|
110
|
-
"date-fns": "^
|
|
263
|
+
"date-fns": "^3.6.0",
|
|
111
264
|
"embla-carousel-react": "8.5.1",
|
|
265
|
+
"filesize": "^11.0.2",
|
|
266
|
+
"framer-motion": "^11.15.0",
|
|
112
267
|
"input-otp": "^1.0.1",
|
|
113
268
|
"lodash.castarray": "^4.4.0",
|
|
114
269
|
"lodash.isplainobject": "^4.0.6",
|
|
115
270
|
"lodash.merge": "^4.6.2",
|
|
271
|
+
"lucide-react": "0.456.0",
|
|
116
272
|
"markdown-to-jsx": "^7.7.13",
|
|
117
273
|
"mermaid": "^11.12.0",
|
|
118
274
|
"postcss-selector-parser": "^6.0.16",
|
|
119
275
|
"qrcode.react": "^4.2.0",
|
|
120
276
|
"react-day-picker": "^8.10.1",
|
|
277
|
+
"react-dropzone": "^14.3.5",
|
|
121
278
|
"react-intersection-observer": "^9.8.2",
|
|
279
|
+
"react-markdown": "^9.0.3",
|
|
122
280
|
"react-resizable-panels": "^3.0.6",
|
|
281
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
282
|
+
"rehype-katex": "^7.0.1",
|
|
283
|
+
"remark-gfm": "^4.0.0",
|
|
284
|
+
"remark-math": "^6.0.0",
|
|
123
285
|
"sonner": "^1.4.41",
|
|
124
286
|
"sql.js": "^1.13.0",
|
|
125
287
|
"svg-pan-zoom": "^3.6.2",
|
|
@@ -154,7 +316,9 @@
|
|
|
154
316
|
"@types/react": "18.3.1",
|
|
155
317
|
"@types/react-dom": "18.3.1",
|
|
156
318
|
"glob": "^11.0.2",
|
|
319
|
+
"jest": "^30.1.3",
|
|
157
320
|
"tailwindcss": "3.4.14",
|
|
321
|
+
"tsup": "^8.5.0",
|
|
158
322
|
"typescript": "5.6.3"
|
|
159
323
|
}
|
|
160
324
|
}
|
package/primitives/accordion.tsx
CHANGED
package/primitives/alert.tsx
CHANGED
package/primitives/avatar.tsx
CHANGED
package/primitives/badge.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { cn } from '../src/utils';
|
|
5
5
|
|
|
@@ -42,3 +42,4 @@ const Badge = ({ className, variant, ...props }: BadgeProps) => {
|
|
|
42
42
|
Badge.displayName = 'Badge';
|
|
43
43
|
|
|
44
44
|
export { Badge, badgeVariants };
|
|
45
|
+
export default Badge;
|
package/primitives/button.tsx
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
import { Slot } from '@radix-ui/react-slot';
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { Loader2 } from 'lucide-react';
|
|
4
|
-
import
|
|
4
|
+
import React from 'react';
|
|
5
5
|
|
|
6
6
|
import { cn } from '../src/utils';
|
|
7
7
|
|
|
8
8
|
const buttonVariants = cva(
|
|
9
|
-
'inline-flex items-center justify-center gap-2
|
|
9
|
+
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
13
|
default:
|
|
14
|
-
'bg-
|
|
14
|
+
'bg-primary text-primary-foreground shadow hover:bg-primary/90',
|
|
15
15
|
destructive:
|
|
16
|
-
'
|
|
16
|
+
'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
|
|
17
17
|
outline:
|
|
18
|
-
'border border-
|
|
19
|
-
|
|
20
|
-
'bg-
|
|
21
|
-
|
|
18
|
+
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
19
|
+
secondary:
|
|
20
|
+
'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
|
|
21
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
22
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
23
|
+
// Keep the additional Hanzo variants for backward compatibility
|
|
24
|
+
primary:
|
|
25
|
+
'bg-primary text-primary-foreground shadow hover:bg-primary/90',
|
|
26
|
+
linkFG: 'text-primary underline-offset-4 hover:underline',
|
|
27
|
+
linkMuted: 'text-muted-foreground underline-offset-4 hover:underline hover:text-foreground',
|
|
22
28
|
},
|
|
23
29
|
size: {
|
|
24
|
-
default: 'h-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
md: 'h-[40px] gap-1.5 px-3 text-xs',
|
|
28
|
-
lg: 'h-[48px] gap-2 px-2 text-sm',
|
|
30
|
+
default: 'h-9 px-4 py-2',
|
|
31
|
+
sm: 'h-8 rounded-md px-3 text-xs',
|
|
32
|
+
lg: 'h-10 rounded-md px-8',
|
|
29
33
|
icon: 'h-9 w-9',
|
|
30
|
-
auto: 'h-auto p-4',
|
|
31
|
-
},
|
|
32
|
-
rounded: {
|
|
33
|
-
full: 'rounded-full',
|
|
34
|
-
lg: 'rounded-lg',
|
|
35
34
|
},
|
|
36
35
|
},
|
|
37
36
|
defaultVariants: {
|
|
38
37
|
variant: 'default',
|
|
39
38
|
size: 'default',
|
|
40
|
-
rounded: 'full',
|
|
41
39
|
},
|
|
42
40
|
},
|
|
43
41
|
);
|
|
@@ -47,36 +45,28 @@ export interface ButtonProps
|
|
|
47
45
|
VariantProps<typeof buttonVariants> {
|
|
48
46
|
asChild?: boolean;
|
|
49
47
|
isLoading?: boolean;
|
|
50
|
-
ref?: React.RefObject<HTMLButtonElement>;
|
|
51
48
|
}
|
|
52
49
|
|
|
53
|
-
const Button = (
|
|
54
|
-
className,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
className={cn('h-4 w-4 animate-spin', size !== 'icon' && 'mr-2')}
|
|
73
|
-
/>
|
|
74
|
-
) : null}
|
|
75
|
-
{isLoading && size === 'icon' ? null : props.children}
|
|
76
|
-
</Comp>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
50
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
51
|
+
({ className, variant, size, asChild = false, isLoading = false, children, ...props }, ref) => {
|
|
52
|
+
const Comp = asChild ? Slot : 'button';
|
|
53
|
+
return (
|
|
54
|
+
<Comp
|
|
55
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
56
|
+
ref={ref}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
{isLoading ? (
|
|
60
|
+
<Loader2
|
|
61
|
+
className={cn('h-4 w-4 animate-spin', size !== 'icon' && 'mr-2')}
|
|
62
|
+
/>
|
|
63
|
+
) : null}
|
|
64
|
+
{isLoading && size === 'icon' ? null : children}
|
|
65
|
+
</Comp>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
);
|
|
80
69
|
Button.displayName = 'Button';
|
|
81
70
|
|
|
82
71
|
export { Button, buttonVariants };
|
|
72
|
+
export default Button; // Keep default export for backward compatibility
|
package/primitives/card.tsx
CHANGED
package/primitives/carousel.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import useEmblaCarousel from 'embla-carousel-react'
|
|
5
|
-
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
const { EmblaCarouselType, EmblaOptionsType, EmblaPluginType } = {}
|
|
6
7
|
|
|
7
8
|
import { ArrowLeft, ArrowRight } from 'lucide-react'
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { useTranslation } from '@hanzo_network/hanzo-i18n';
|
|
2
|
-
|
|
1
|
+
// import { useTranslation } from '@hanzo_network/hanzo-i18n';
|
|
2
|
+
const useTranslation = () => ({ t: (key) => key });
|
|
3
|
+
import React from 'react';
|
|
3
4
|
|
|
4
|
-
import { useCombinedRefs } from '../../hooks/use-combined-refs';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { useCombinedRefs } from '../../src/hooks/use-combined-refs';
|
|
6
|
+
import { cn } from '../../src/utils';
|
|
6
7
|
import { ChatInput } from './chat-input';
|
|
7
8
|
|
|
8
9
|
type ChatInputAreaProps = {
|
|
@@ -3,10 +3,11 @@ import {
|
|
|
3
3
|
type Attachment,
|
|
4
4
|
FileTypeSupported,
|
|
5
5
|
} from '@hanzo_network/hanzo-node-state/v2/queries/getChatConversation/types';
|
|
6
|
-
import { save } from '@tauri-apps/plugin-dialog';
|
|
7
|
-
import * as fs from '@tauri-apps/plugin-fs';
|
|
8
|
-
import { BaseDirectory } from '@tauri-apps/plugin-fs';
|
|
9
|
-
import { partial } from 'filesize';
|
|
6
|
+
// import { save } from '@tauri-apps/plugin-dialog'; // Not available in web environment
|
|
7
|
+
// import * as fs from '@tauri-apps/plugin-fs'; // Not available in web environment
|
|
8
|
+
// import { BaseDirectory } from '@tauri-apps/plugin-fs'; // Not available in web environment
|
|
9
|
+
// import { partial } from 'filesize';
|
|
10
|
+
const partial = () => (bytes) => `${(bytes / 1024 / 1024).toFixed(2)} MB`;
|
|
10
11
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
11
12
|
import { CircleSlashIcon, XIcon } from 'lucide-react';
|
|
12
13
|
import React, { useState } from 'react';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ChatConversationInfiniteData } from '@hanzo_network/hanzo-node-state/v2/queries/getChatConversation/types';
|
|
1
|
+
// import { ChatConversationInfiniteData } from '@hanzo_network/hanzo-node-state/v2/queries/getChatConversation/types';
|
|
2
|
+
type ChatConversationInfiniteData = any;
|
|
2
3
|
import {
|
|
3
4
|
type FetchPreviousPageOptions,
|
|
4
5
|
type InfiniteQueryObserverResult,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { debug } from '@tauri-apps/plugin-log';
|
|
1
|
+
// import { debug } from '@tauri-apps/plugin-log'; // Not available in web environment
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import * as sqljs from 'sql.js';
|
|
4
4
|
|
|
@@ -13,9 +13,9 @@ const loadTableData = async (
|
|
|
13
13
|
db: sqljs.Database,
|
|
14
14
|
tableName: string,
|
|
15
15
|
): Promise<{ values: sqljs.SqlValue[][] }> => {
|
|
16
|
-
void
|
|
16
|
+
void console.log(`loading table data for ${tableName}`);
|
|
17
17
|
const dataResult = db.exec(`SELECT * FROM ${tableName}`);
|
|
18
|
-
void
|
|
18
|
+
void console.log(`found ${dataResult[0].values.length} rows for ${tableName}`);
|
|
19
19
|
return { values: dataResult[0].values };
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ const loadDatabase = async (
|
|
|
25
25
|
db: sqljs.Database;
|
|
26
26
|
tables: { name: string; columns: sqljs.SqlValue[]; count: number }[];
|
|
27
27
|
}> => {
|
|
28
|
-
void
|
|
28
|
+
void console.log(`loading database from ${url}`);
|
|
29
29
|
const SQL = await sqljs.default({
|
|
30
30
|
locateFile: (file: string) => '/sqljs/sql-wasm.wasm',
|
|
31
31
|
});
|
|
@@ -39,14 +39,14 @@ const loadDatabase = async (
|
|
|
39
39
|
"SELECT name FROM sqlite_master WHERE type='table'",
|
|
40
40
|
);
|
|
41
41
|
const tableNames = tablesResult[0].values.map((v) => v[0] as string);
|
|
42
|
-
void
|
|
43
|
-
void
|
|
42
|
+
void console.log(`found ${tableNames.length} tables`);
|
|
43
|
+
void console.log(`tables: ${tableNames.join(', ')}`);
|
|
44
44
|
const tables = tableNames.map((table) => {
|
|
45
45
|
const columnsResult = db.exec(`PRAGMA table_info(${table})`);
|
|
46
46
|
const columnNames = columnsResult[0].values.map((v) => v[1]);
|
|
47
47
|
const countResult = db.exec(`SELECT COUNT(*) FROM ${table}`);
|
|
48
48
|
const count = countResult[0].values[0][0] as number;
|
|
49
|
-
void
|
|
49
|
+
void console.log(
|
|
50
50
|
`found columns ${columnNames.join(', ')} and ${count} rows for ${table}`,
|
|
51
51
|
);
|
|
52
52
|
return {
|
|
@@ -128,7 +128,7 @@ export const SqlitePreview: React.FC<SqlitePreviewProps> = ({ url }) => {
|
|
|
128
128
|
useEffect(() => {
|
|
129
129
|
return () => {
|
|
130
130
|
if (db) {
|
|
131
|
-
void
|
|
131
|
+
void console.log('closing database connection');
|
|
132
132
|
db.close();
|
|
133
133
|
}
|
|
134
134
|
};
|
package/primitives/checkbox.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
2
|
import { CheckIcon } from '@radix-ui/react-icons';
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
|
|
5
5
|
import { cn } from '../src/utils';
|
|
6
6
|
|
|
@@ -29,3 +29,4 @@ const Checkbox = ({ className, ref, ...props }: CheckboxProps) => (
|
|
|
29
29
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
30
30
|
|
|
31
31
|
export { Checkbox };
|
|
32
|
+
export default Checkbox;
|
package/primitives/command.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { DialogProps } from '@radix-ui/react-dialog';
|
|
2
4
|
import { Command as CommandPrimitive } from 'cmdk';
|
|
3
5
|
import { Search } from 'lucide-react';
|
|
4
|
-
import
|
|
6
|
+
import React from 'react';
|
|
5
7
|
|
|
6
8
|
import { cn } from '../src/utils';
|
|
7
9
|
import { Dialog, DialogContent } from './dialog';
|