@hanzo/ui 4.5.3 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-MCP.md +3 -3
- package/README.md +229 -0
- package/assets/ai-icons.tsx +207 -0
- package/assets/crypto.tsx +33 -0
- package/assets/file-type-icon.tsx +66 -0
- package/assets/file.tsx +45 -0
- package/assets/general.tsx +2318 -0
- package/assets/hanzo-logo.svg +9 -0
- package/assets/hanzo-logo.tsx +15 -0
- package/assets/index.ts +8 -0
- package/assets/index.tsx +4 -0
- package/assets/llm-provider.tsx +1094 -0
- package/bin/create-registry.js +1 -1
- package/bin/test-mcp.sh +1 -1
- package/bin/update-registry.js +2 -2
- package/blocks/components/content.tsx +1 -1
- package/blocks/components/grid-block/index.tsx +1 -1
- package/blocks/components/screenful-block/content.tsx +1 -1
- package/blocks/components/screenful-block/poster-background.tsx +1 -1
- package/components/index.ts +56 -0
- package/dist/button.d.ts +1 -0
- package/dist/button.js +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/use-click-away.d.ts +2 -0
- package/dist/hooks/use-click-away.js +23 -0
- package/dist/hooks/use-combined-refs.d.ts +3 -0
- package/dist/hooks/use-combined-refs.js +18 -0
- package/dist/hooks/use-copy-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-clipboard.js +21 -0
- package/dist/hooks/use-debounce.d.ts +1 -0
- package/dist/hooks/use-debounce.js +13 -0
- package/dist/hooks/use-fill-ids.d.ts +8 -0
- package/dist/hooks/use-fill-ids.js +20 -0
- package/dist/hooks/use-map.d.ts +1 -0
- package/dist/hooks/use-map.js +20 -0
- package/dist/hooks/use-measure.d.ts +8 -0
- package/dist/hooks/use-measure.js +25 -0
- package/dist/hooks/use-reverse-video-playback.d.ts +1 -0
- package/dist/hooks/use-reverse-video-playback.js +41 -0
- package/dist/hooks/use-scroll-restoration.d.ts +8 -0
- package/dist/hooks/use-scroll-restoration.js +36 -0
- package/dist/mcp/enhanced-server.js +3 -3
- package/dist/mcp/index.js +1 -1
- package/dist/registry/api.d.ts +1 -1
- package/dist/registry/api.js +3 -4
- package/dist/registry/index.d.ts +348 -4
- package/dist/registry/index.js +3 -3
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -0
- package/helpers/file.ts +33 -0
- package/helpers/memoization.ts +40 -0
- package/package.json +27 -6
- package/primitives/accordion.tsx +53 -45
- package/primitives/alert-dialog.tsx +185 -0
- package/primitives/alert.tsx +74 -0
- package/primitives/apply-typography.tsx +1 -1
- package/primitives/avatar.tsx +37 -29
- package/primitives/background-beams.tsx +142 -0
- package/primitives/badge.tsx +27 -19
- package/primitives/breadcrumb.tsx +77 -62
- package/primitives/button.tsx +69 -72
- package/primitives/card.tsx +73 -59
- package/primitives/chat/chat-input-area.tsx +87 -0
- package/primitives/chat/chat-input.tsx +71 -0
- package/primitives/chat/files-preview.tsx +330 -0
- package/primitives/chat/index.ts +6 -0
- package/primitives/chat/json-form.tsx +8 -0
- package/primitives/chat/message-list.tsx +307 -0
- package/primitives/chat/message.tsx +569 -0
- package/primitives/chat/sqlite-preview.tsx +215 -0
- package/primitives/checkbox.tsx +18 -19
- package/primitives/collapsible.tsx +9 -0
- package/primitives/command.tsx +75 -83
- package/primitives/context-menu.tsx +115 -109
- package/primitives/copy-to-clipboard-icon.tsx +60 -0
- package/primitives/dialog-video-controller.tsx +1 -1
- package/primitives/dialog.tsx +111 -145
- package/primitives/dot-pattern.tsx +57 -0
- package/primitives/dots-loader.tsx +13 -0
- package/primitives/drawer.tsx +59 -87
- package/primitives/dropdown-menu.tsx +199 -0
- package/primitives/error-message.tsx +19 -0
- package/primitives/file-uploader.tsx +200 -0
- package/primitives/form.tsx +92 -87
- package/primitives/hover-card.tsx +28 -0
- package/primitives/icons/github.tsx +1 -1
- package/primitives/icons/youtube-logo.tsx +1 -1
- package/primitives/index-common.ts +121 -42
- package/primitives/index-next.ts +3 -1
- package/primitives/input.tsx +115 -20
- package/primitives/label.tsx +15 -23
- package/primitives/loading-spinner.tsx +1 -1
- package/primitives/markdown-preview.tsx +609 -0
- package/primitives/mermaid.tsx +196 -0
- package/primitives/next/link-element.tsx +1 -1
- package/primitives/next/mdx-link.tsx +1 -1
- package/primitives/pagination.tsx +117 -0
- package/primitives/popover.tsx +20 -25
- package/primitives/pretty-json-print.tsx +28 -0
- package/primitives/progress.tsx +14 -15
- package/primitives/prompt-textarea.tsx +72 -0
- package/primitives/qr-code.tsx +112 -0
- package/primitives/radio-group.tsx +25 -39
- package/primitives/resizable.tsx +47 -0
- package/primitives/scroll-area.tsx +35 -25
- package/primitives/search-input.tsx +66 -0
- package/primitives/select.tsx +62 -109
- package/primitives/separator.tsx +22 -26
- package/primitives/sheet.tsx +78 -117
- package/primitives/skeleton.tsx +13 -16
- package/primitives/slider.tsx +50 -60
- package/primitives/stepper.tsx +272 -0
- package/primitives/switch.tsx +14 -23
- package/primitives/table.tsx +65 -77
- package/primitives/tabs.tsx +29 -39
- package/primitives/text-link.tsx +25 -0
- package/primitives/textarea.tsx +61 -0
- package/primitives/textfield.tsx +75 -0
- package/primitives/toast.tsx +30 -0
- package/primitives/toggle-group.tsx +33 -33
- package/primitives/toggle.tsx +22 -51
- package/primitives/tooltip.tsx +37 -38
- package/registry.json +1 -1
- package/src/button.ts +1 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/use-click-away.ts +31 -0
- package/src/hooks/use-combined-refs.ts +22 -0
- package/src/hooks/use-copy-clipboard.ts +30 -0
- package/src/hooks/use-debounce.ts +17 -0
- package/src/hooks/use-fill-ids.ts +25 -0
- package/src/hooks/use-map.ts +26 -0
- package/src/hooks/use-measure.ts +42 -0
- package/src/hooks/use-reverse-video-playback.ts +43 -0
- package/src/hooks/use-scroll-restoration.ts +50 -0
- package/{mcp → src/mcp}/README.md +1 -1
- package/{mcp → src/mcp}/enhanced-server.ts +2 -2
- package/{registry → src/registry}/api.ts +3 -3
- package/{registry → src/registry}/index.ts +3 -3
- package/src/utils.ts +1 -0
- package/style/theme-provider.tsx +1 -1
- package/test-imports.mjs +19 -0
- package/tsconfig.json +9 -4
- package/types/animation-def.ts +1 -1
- package/types/button-def.ts +1 -1
- package/types/index.ts +1 -1
- package/util/blob.ts +28 -0
- package/util/copy-to-clipboard.ts +17 -0
- package/util/create-shadow-root.ts +22 -0
- package/util/date.ts +83 -0
- package/util/debounce.ts +11 -0
- package/util/file.ts +15 -0
- package/util/format-and-abbreviate-as-currency.ts +1 -1
- package/util/format-text.ts +33 -0
- package/util/index.ts +9 -78
- package/util/timing.ts +3 -0
- package/util/toasts.tsx +17 -0
- package/utils.ts +9 -0
- package/dist/blocks/components/accordian-block.d.ts +0 -4
- package/dist/blocks/components/accordian-block.jsx +0 -25
- package/dist/blocks/components/block-component-props.d.ts +0 -7
- package/dist/blocks/components/block-component-props.js +0 -1
- package/dist/blocks/components/bullet-cards-block.d.ts +0 -4
- package/dist/blocks/components/bullet-cards-block.jsx +0 -25
- package/dist/blocks/components/card-block/index.d.ts +0 -6
- package/dist/blocks/components/card-block/index.jsx +0 -87
- package/dist/blocks/components/card-block/link-out-button.d.ts +0 -6
- package/dist/blocks/components/card-block/link-out-button.jsx +0 -4
- package/dist/blocks/components/card-block/util.d.ts +0 -4
- package/dist/blocks/components/card-block/util.js +0 -6
- package/dist/blocks/components/carte-blanche-block/index.d.ts +0 -4
- package/dist/blocks/components/carte-blanche-block/index.jsx +0 -82
- package/dist/blocks/components/carte-blanche-block/variant-content-left.d.ts +0 -10
- package/dist/blocks/components/carte-blanche-block/variant-content-left.jsx +0 -23
- package/dist/blocks/components/content.d.ts +0 -10
- package/dist/blocks/components/content.jsx +0 -47
- package/dist/blocks/components/cta-block.d.ts +0 -12
- package/dist/blocks/components/cta-block.jsx +0 -69
- package/dist/blocks/components/enh-heading-block.d.ts +0 -7
- package/dist/blocks/components/enh-heading-block.jsx +0 -142
- package/dist/blocks/components/grid-block/grid-block-mutator.d.ts +0 -5
- package/dist/blocks/components/grid-block/grid-block-mutator.js +0 -1
- package/dist/blocks/components/grid-block/index.d.ts +0 -9
- package/dist/blocks/components/grid-block/index.jsx +0 -56
- package/dist/blocks/components/grid-block/mutator-registry.d.ts +0 -3
- package/dist/blocks/components/grid-block/mutator-registry.js +0 -5
- package/dist/blocks/components/grid-block/table-borders.mutator.d.ts +0 -3
- package/dist/blocks/components/grid-block/table-borders.mutator.js +0 -36
- package/dist/blocks/components/group-block.d.ts +0 -7
- package/dist/blocks/components/group-block.jsx +0 -61
- package/dist/blocks/components/heading-block.d.ts +0 -4
- package/dist/blocks/components/heading-block.jsx +0 -99
- package/dist/blocks/components/image-block.d.ts +0 -7
- package/dist/blocks/components/image-block.jsx +0 -69
- package/dist/blocks/components/index.d.ts +0 -14
- package/dist/blocks/components/index.js +0 -13
- package/dist/blocks/components/screenful-block/content.d.ts +0 -8
- package/dist/blocks/components/screenful-block/content.jsx +0 -71
- package/dist/blocks/components/screenful-block/index.d.ts +0 -12
- package/dist/blocks/components/screenful-block/index.jsx +0 -57
- package/dist/blocks/components/screenful-block/poster-background.d.ts +0 -7
- package/dist/blocks/components/screenful-block/poster-background.jsx +0 -14
- package/dist/blocks/components/screenful-block/video-background.d.ts +0 -8
- package/dist/blocks/components/screenful-block/video-background.jsx +0 -20
- package/dist/blocks/components/space-block.d.ts +0 -4
- package/dist/blocks/components/space-block.jsx +0 -42
- package/dist/blocks/components/video-block.d.ts +0 -9
- package/dist/blocks/components/video-block.jsx +0 -83
- package/dist/blocks/def/accordian-block.d.ts +0 -10
- package/dist/blocks/def/accordian-block.js +0 -2
- package/dist/blocks/def/block.d.ts +0 -4
- package/dist/blocks/def/block.js +0 -1
- package/dist/blocks/def/bullet-cards-block.d.ts +0 -17
- package/dist/blocks/def/bullet-cards-block.js +0 -1
- package/dist/blocks/def/card-block.d.ts +0 -17
- package/dist/blocks/def/card-block.js +0 -2
- package/dist/blocks/def/carte-blanche-block.d.ts +0 -12
- package/dist/blocks/def/carte-blanche-block.js +0 -1
- package/dist/blocks/def/cta-block.d.ts +0 -8
- package/dist/blocks/def/cta-block.js +0 -1
- package/dist/blocks/def/element-block.d.ts +0 -7
- package/dist/blocks/def/element-block.js +0 -2
- package/dist/blocks/def/enh-heading-block.d.ts +0 -22
- package/dist/blocks/def/enh-heading-block.js +0 -1
- package/dist/blocks/def/grid-block.d.ts +0 -12
- package/dist/blocks/def/grid-block.js +0 -1
- package/dist/blocks/def/group-block.d.ts +0 -7
- package/dist/blocks/def/group-block.js +0 -1
- package/dist/blocks/def/heading-block.d.ts +0 -11
- package/dist/blocks/def/heading-block.js +0 -1
- package/dist/blocks/def/image-block.d.ts +0 -26
- package/dist/blocks/def/image-block.js +0 -1
- package/dist/blocks/def/index.d.ts +0 -17
- package/dist/blocks/def/index.js +0 -2
- package/dist/blocks/def/screenful-block.d.ts +0 -41
- package/dist/blocks/def/screenful-block.js +0 -1
- package/dist/blocks/def/space-block.d.ts +0 -47
- package/dist/blocks/def/space-block.js +0 -8
- package/dist/blocks/def/video-block.d.ts +0 -5
- package/dist/blocks/def/video-block.js +0 -1
- package/dist/blocks/index.d.ts +0 -2
- package/dist/blocks/index.js +0 -2
- package/dist/primitives/accordion.d.ts +0 -10
- package/dist/primitives/accordion.jsx +0 -21
- package/dist/primitives/action-button.d.ts +0 -9
- package/dist/primitives/action-button.jsx +0 -16
- package/dist/primitives/apply-typography.d.ts +0 -7
- package/dist/primitives/apply-typography.jsx +0 -38
- package/dist/primitives/aspect-ratio.d.ts +0 -3
- package/dist/primitives/aspect-ratio.jsx +0 -4
- package/dist/primitives/avatar.d.ts +0 -6
- package/dist/primitives/avatar.jsx +0 -11
- package/dist/primitives/badge.d.ts +0 -9
- package/dist/primitives/badge.jsx +0 -18
- package/dist/primitives/breadcrumb.d.ts +0 -19
- package/dist/primitives/breadcrumb.jsx +0 -27
- package/dist/primitives/breakpoint-indicator.d.ts +0 -3
- package/dist/primitives/breakpoint-indicator.jsx +0 -14
- package/dist/primitives/button.d.ts +0 -12
- package/dist/primitives/button.jsx +0 -55
- package/dist/primitives/calendar.d.ts +0 -8
- package/dist/primitives/calendar.jsx +0 -40
- package/dist/primitives/card.d.ts +0 -8
- package/dist/primitives/card.jsx +0 -18
- package/dist/primitives/carousel.d.ts +0 -18
- package/dist/primitives/carousel.jsx +0 -106
- package/dist/primitives/checkbox.d.ts +0 -4
- package/dist/primitives/checkbox.jsx +0 -15
- package/dist/primitives/combobox.d.ts +0 -41
- package/dist/primitives/combobox.jsx +0 -77
- package/dist/primitives/command.d.ts +0 -17
- package/dist/primitives/command.jsx +0 -38
- package/dist/primitives/context-menu.d.ts +0 -27
- package/dist/primitives/context-menu.jsx +0 -57
- package/dist/primitives/dialog-video-controller.d.ts +0 -3
- package/dist/primitives/dialog-video-controller.jsx +0 -24
- package/dist/primitives/dialog.d.ts +0 -28
- package/dist/primitives/dialog.jsx +0 -37
- package/dist/primitives/drawer.d.ts +0 -29
- package/dist/primitives/drawer.jsx +0 -34
- package/dist/primitives/form.d.ts +0 -12
- package/dist/primitives/form.jsx +0 -69
- package/dist/primitives/icons/github.d.ts +0 -4
- package/dist/primitives/icons/github.jsx +0 -6
- package/dist/primitives/icons/index.d.ts +0 -4
- package/dist/primitives/icons/index.js +0 -4
- package/dist/primitives/icons/youtube-logo.d.ts +0 -4
- package/dist/primitives/icons/youtube-logo.jsx +0 -39
- package/dist/primitives/index-common.d.ts +0 -47
- package/dist/primitives/index-common.js +0 -46
- package/dist/primitives/index-next.d.ts +0 -2
- package/dist/primitives/index-next.js +0 -2
- package/dist/primitives/input-otp.d.ts +0 -7
- package/dist/primitives/input-otp.jsx +0 -24
- package/dist/primitives/input.d.ts +0 -5
- package/dist/primitives/input.jsx +0 -11
- package/dist/primitives/label.d.ts +0 -5
- package/dist/primitives/label.jsx +0 -11
- package/dist/primitives/list-adaptor.d.ts +0 -9
- package/dist/primitives/list-adaptor.js +0 -1
- package/dist/primitives/list-box.d.ts +0 -10
- package/dist/primitives/list-box.jsx +0 -14
- package/dist/primitives/loading-spinner.d.ts +0 -5
- package/dist/primitives/loading-spinner.jsx +0 -8
- package/dist/primitives/navigation-menu.d.ts +0 -12
- package/dist/primitives/navigation-menu.jsx +0 -38
- package/dist/primitives/next/image.d.ts +0 -11
- package/dist/primitives/next/image.jsx +0 -42
- package/dist/primitives/next/index.d.ts +0 -7
- package/dist/primitives/next/index.js +0 -7
- package/dist/primitives/next/inline-icon.d.ts +0 -13
- package/dist/primitives/next/inline-icon.jsx +0 -15
- package/dist/primitives/next/link-element.d.ts +0 -23
- package/dist/primitives/next/link-element.jsx +0 -56
- package/dist/primitives/next/mdx-link.d.ts +0 -3
- package/dist/primitives/next/mdx-link.jsx +0 -12
- package/dist/primitives/next/media-stack.d.ts +0 -8
- package/dist/primitives/next/media-stack.jsx +0 -28
- package/dist/primitives/next/nav-items.d.ts +0 -10
- package/dist/primitives/next/nav-items.jsx +0 -24
- package/dist/primitives/next/youtube-embed.d.ts +0 -11
- package/dist/primitives/next/youtube-embed.jsx +0 -23
- package/dist/primitives/popover.d.ts +0 -9
- package/dist/primitives/popover.jsx +0 -18
- package/dist/primitives/progress.d.ts +0 -4
- package/dist/primitives/progress.jsx +0 -9
- package/dist/primitives/radio-group.d.ts +0 -7
- package/dist/primitives/radio-group.jsx +0 -18
- package/dist/primitives/scroll-area.d.ts +0 -5
- package/dist/primitives/scroll-area.jsx +0 -19
- package/dist/primitives/select.d.ts +0 -13
- package/dist/primitives/select.jsx +0 -62
- package/dist/primitives/separator.d.ts +0 -4
- package/dist/primitives/separator.jsx +0 -7
- package/dist/primitives/sheet.d.ts +0 -30
- package/dist/primitives/sheet.jsx +0 -56
- package/dist/primitives/skeleton.d.ts +0 -4
- package/dist/primitives/skeleton.jsx +0 -3
- package/dist/primitives/slider.d.ts +0 -9
- package/dist/primitives/slider.jsx +0 -30
- package/dist/primitives/sonner.d.ts +0 -5
- package/dist/primitives/sonner.jsx +0 -16
- package/dist/primitives/step-indicator.d.ts +0 -9
- package/dist/primitives/step-indicator.jsx +0 -23
- package/dist/primitives/switch.d.ts +0 -6
- package/dist/primitives/switch.jsx +0 -14
- package/dist/primitives/table.d.ts +0 -10
- package/dist/primitives/table.jsx +0 -21
- package/dist/primitives/tabs.d.ts +0 -7
- package/dist/primitives/tabs.jsx +0 -18
- package/dist/primitives/text-area.d.ts +0 -5
- package/dist/primitives/text-area.jsx +0 -9
- package/dist/primitives/toggle-group.d.ts +0 -14
- package/dist/primitives/toggle-group.jsx +0 -28
- package/dist/primitives/toggle.d.ts +0 -14
- package/dist/primitives/toggle.jsx +0 -52
- package/dist/primitives/tooltip.d.ts +0 -11
- package/dist/primitives/tooltip.jsx +0 -18
- package/dist/primitives/video-player.d.ts +0 -6
- package/dist/primitives/video-player.jsx +0 -8
- package/dist/style/theme-provider.d.ts +0 -4
- package/dist/style/theme-provider.jsx +0 -11
- package/dist/tailwind/fontFamily.tailwind.d.ts +0 -8
- package/dist/tailwind/fontFamily.tailwind.js +0 -7
- package/dist/tailwind/fontSize.tailwind.d.ts +0 -36
- package/dist/tailwind/fontSize.tailwind.js +0 -13
- package/dist/tailwind/index.d.ts +0 -3
- package/dist/tailwind/index.js +0 -2
- package/dist/tailwind/screens.tailwind.d.ts +0 -9
- package/dist/tailwind/screens.tailwind.js +0 -8
- package/dist/tailwind/tw-font-desc.d.ts +0 -6
- package/dist/tailwind/tw-font-desc.js +0 -6
- package/dist/types/animation-def.d.ts +0 -2
- package/dist/types/animation-def.js +0 -1
- package/dist/types/breakpoints.d.ts +0 -4
- package/dist/types/breakpoints.js +0 -4
- package/dist/types/bullet-item.d.ts +0 -6
- package/dist/types/bullet-item.js +0 -2
- package/dist/types/button-def.d.ts +0 -29
- package/dist/types/button-def.js +0 -2
- package/dist/types/dimensions.d.ts +0 -5
- package/dist/types/dimensions.js +0 -1
- package/dist/types/grid-def.d.ts +0 -36
- package/dist/types/grid-def.js +0 -33
- package/dist/types/image-def.d.ts +0 -27
- package/dist/types/image-def.js +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.js +0 -2
- package/dist/types/link-def.d.ts +0 -44
- package/dist/types/link-def.js +0 -1
- package/dist/types/media-stack-def.d.ts +0 -25
- package/dist/types/media-stack-def.js +0 -1
- package/dist/types/t-shirt-size.d.ts +0 -2
- package/dist/types/t-shirt-size.js +0 -1
- package/dist/types/tshirt-dimensions.d.ts +0 -12
- package/dist/types/tshirt-dimensions.js +0 -1
- package/dist/types/video-def.d.ts +0 -9
- package/dist/types/video-def.js +0 -1
- package/dist/util/format-and-abbreviate-as-currency.d.ts +0 -11
- package/dist/util/format-and-abbreviate-as-currency.js +0 -91
- package/dist/util/format-to-max-char.d.ts +0 -5
- package/dist/util/format-to-max-char.js +0 -57
- package/dist/util/index-client.d.ts +0 -2
- package/dist/util/index-client.js +0 -3
- package/dist/util/index.d.ts +0 -17
- package/dist/util/index.js +0 -41
- package/dist/util/number-abbreviate.d.ts +0 -9
- package/dist/util/number-abbreviate.js +0 -30
- package/dist/util/specifier.d.ts +0 -7
- package/dist/util/specifier.js +0 -31
- package/dist/util/spread-to-transform.d.ts +0 -7
- package/dist/util/spread-to-transform.js +0 -18
- package/dist/util/step-animation.d.ts +0 -5
- package/dist/util/step-animation.js +0 -60
- package/dist/util/two-way-map.d.ts +0 -8
- package/dist/util/two-way-map.js +0 -16
- /package/{mcp → src/mcp}/index.ts +0 -0
- /package/{mcp → src/mcp}/package.json +0 -0
- /package/{registry → src/registry}/package.json +0 -0
package/README-MCP.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Hanzo UI with MCP Support
|
|
2
2
|
|
|
3
|
-
This implementation provides Model Context Protocol (MCP) support for the Hanzo UI library, enabling AI assistants to interact with the component registry based on
|
|
3
|
+
This implementation provides Model Context Protocol (MCP) support for the Hanzo UI library, enabling AI assistants to interact with the component registry based on hanzo/ui.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
@@ -91,7 +91,7 @@ node ./bin/cli.js registry:mcp
|
|
|
91
91
|
|
|
92
92
|
### Creating a Registry
|
|
93
93
|
|
|
94
|
-
The registry is compatible with
|
|
94
|
+
The registry is compatible with hanzo/ui's registry format. To create a custom registry:
|
|
95
95
|
|
|
96
96
|
1. Create a `registry.json` file using the schema from `/pkg/ui/registry/schema.ts`
|
|
97
97
|
2. Build the registry using a build script
|
|
@@ -148,7 +148,7 @@ Which one would you like to add to your project?
|
|
|
148
148
|
|
|
149
149
|
### Registry Schema
|
|
150
150
|
|
|
151
|
-
The registry schema is compatible with
|
|
151
|
+
The registry schema is compatible with hanzo/ui and includes:
|
|
152
152
|
|
|
153
153
|
- Component metadata (name, description, type)
|
|
154
154
|
- Dependencies (npm packages)
|
package/README.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# @hanzo/ui
|
|
2
|
+
|
|
3
|
+
A comprehensive UI component library for Hanzo applications, built with React and TypeScript.
|
|
4
|
+
|
|
5
|
+
## Version 4.5.6
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @hanzo/ui
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @hanzo/ui
|
|
13
|
+
# or
|
|
14
|
+
yarn add @hanzo/ui
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Components
|
|
18
|
+
|
|
19
|
+
### Primitives
|
|
20
|
+
|
|
21
|
+
Core UI components based on Radix UI primitives:
|
|
22
|
+
|
|
23
|
+
- **Accordion** - Collapsible content panels
|
|
24
|
+
- **Alert** - Informative alert messages
|
|
25
|
+
- **AlertDialog** - Modal dialogs for important alerts
|
|
26
|
+
- **Avatar** - User avatar display
|
|
27
|
+
- **Badge** - Status and label badges
|
|
28
|
+
- **Breadcrumb** - Navigation breadcrumbs
|
|
29
|
+
- **Button** - Interactive buttons with variants
|
|
30
|
+
- **Calendar** - Date picker calendar
|
|
31
|
+
- **Card** - Container cards for content
|
|
32
|
+
- **Carousel** - Image/content carousel
|
|
33
|
+
- **Checkbox** - Checkbox input
|
|
34
|
+
- **Collapsible** - Collapsible content sections
|
|
35
|
+
- **Combobox** - Searchable select dropdown
|
|
36
|
+
- **Command** - Command palette component
|
|
37
|
+
- **ContextMenu** - Right-click context menus
|
|
38
|
+
- **Dialog** - Modal dialogs
|
|
39
|
+
- **Drawer** - Slide-out drawer panels
|
|
40
|
+
- **DropdownMenu** - Dropdown menu component
|
|
41
|
+
- **Form** - Form components with validation
|
|
42
|
+
- **HoverCard** - Hover-triggered info cards
|
|
43
|
+
- **Input** - Text input field
|
|
44
|
+
- **InputOTP** - One-time password input
|
|
45
|
+
- **Label** - Form labels
|
|
46
|
+
- **NavigationMenu** - Navigation menu bar
|
|
47
|
+
- **Popover** - Popover overlays
|
|
48
|
+
- **Progress** - Progress indicators
|
|
49
|
+
- **RadioGroup** - Radio button groups
|
|
50
|
+
- **ResizablePanel** - Resizable panel layouts
|
|
51
|
+
- **ScrollArea** - Custom scrollable areas
|
|
52
|
+
- **SearchInput** - Search input with icon
|
|
53
|
+
- **Select** - Select dropdown
|
|
54
|
+
- **Separator** - Visual separator line
|
|
55
|
+
- **Sheet** - Side sheet panels
|
|
56
|
+
- **Skeleton** - Loading skeleton screens
|
|
57
|
+
- **Slider** - Range slider input
|
|
58
|
+
- **Switch** - Toggle switch
|
|
59
|
+
- **Table** - Data tables
|
|
60
|
+
- **Tabs** - Tabbed interfaces
|
|
61
|
+
- **TextArea** - Multi-line text input
|
|
62
|
+
- **TextField** - Enhanced text input
|
|
63
|
+
- **Toast** - Toast notifications (via Sonner)
|
|
64
|
+
- **Toggle** - Toggle buttons
|
|
65
|
+
- **ToggleGroup** - Grouped toggle buttons
|
|
66
|
+
- **Tooltip** - Hover tooltips
|
|
67
|
+
- **VideoPlayer** - Video playback component
|
|
68
|
+
|
|
69
|
+
### Assets
|
|
70
|
+
|
|
71
|
+
Icon components and visual assets:
|
|
72
|
+
|
|
73
|
+
#### AI Provider Icons
|
|
74
|
+
- **AnthropicIcon** - Anthropic AI logo
|
|
75
|
+
- **OpenAIIcon** - OpenAI logo
|
|
76
|
+
- **GeminiIcon** - Google Gemini logo
|
|
77
|
+
- **DeepSeekIcon** - DeepSeek logo
|
|
78
|
+
- **MistralIcon** - Mistral AI logo
|
|
79
|
+
- **MetaIcon** - Meta AI logo
|
|
80
|
+
- **GroqIcon** - Groq logo
|
|
81
|
+
- **OllamaIcon** - Ollama logo
|
|
82
|
+
- **HanzoIcon** - Hanzo AI logo
|
|
83
|
+
- **TogetherAI** - Together AI logo
|
|
84
|
+
- **ExoIcon** - Exo logo
|
|
85
|
+
- **GrokIcon** - Grok logo
|
|
86
|
+
- **LmStudioIcon** - LM Studio logo
|
|
87
|
+
- **OpenRouterIcon** - OpenRouter logo
|
|
88
|
+
- **PerplexityIcon** - Perplexity logo
|
|
89
|
+
- **QwenIcon** - Qwen logo
|
|
90
|
+
- **AyaCohereIcon** - Aya/Cohere logo
|
|
91
|
+
|
|
92
|
+
#### Feature Icons
|
|
93
|
+
- **AIAgentIcon** - AI agent indicator
|
|
94
|
+
- **AisIcon** - AI services icon
|
|
95
|
+
- **ReactJsIcon** - React.js logo
|
|
96
|
+
- **ReasoningIcon** - AI reasoning indicator
|
|
97
|
+
- **ToolsIcon** - Tools/utilities icon
|
|
98
|
+
- **TracingIcon** - Tracing/monitoring icon
|
|
99
|
+
- **ScheduledTasksIcon** - Scheduled tasks icon
|
|
100
|
+
- **SendIcon** - Send/submit icon
|
|
101
|
+
|
|
102
|
+
#### File Type Icons
|
|
103
|
+
- **FileTypeIcon** - Dynamic file type icon based on extension
|
|
104
|
+
- **DirectoryTypeIcon** - Folder/directory icon
|
|
105
|
+
|
|
106
|
+
### Utilities
|
|
107
|
+
|
|
108
|
+
Helper functions and hooks:
|
|
109
|
+
|
|
110
|
+
- **cn()** - Class name utility (clsx + tailwind-merge)
|
|
111
|
+
- **markdown()** - Markdown to JSX converter
|
|
112
|
+
- **formatText()** - Text formatting utilities
|
|
113
|
+
- **useDebounce()** - Debounce hook
|
|
114
|
+
- **useMap()** - Map state management hook
|
|
115
|
+
- **formatDateToLocaleStringWithTime()** - Date formatting
|
|
116
|
+
- **getFileExt()** - File extension extraction
|
|
117
|
+
- **hexToRgb()** - Color conversion utilities
|
|
118
|
+
|
|
119
|
+
### Custom Components
|
|
120
|
+
|
|
121
|
+
Additional enhanced components:
|
|
122
|
+
|
|
123
|
+
- **ChatInput** - Chat message input
|
|
124
|
+
- **ChatInputArea** - Multi-line chat input
|
|
125
|
+
- **ChatSettingsIcon** - Chat settings icon
|
|
126
|
+
- **CopyToClipboardIcon** - Copy to clipboard button
|
|
127
|
+
- **DotsLoader** - Loading dots animation
|
|
128
|
+
- **FileList** - File list display
|
|
129
|
+
- **FileUploader** - File upload component
|
|
130
|
+
- **JsonForm** - JSON-based dynamic forms
|
|
131
|
+
- **MarkdownText** - Markdown renderer
|
|
132
|
+
- **PrettyJsonPrint** - Formatted JSON display
|
|
133
|
+
|
|
134
|
+
## Styling
|
|
135
|
+
|
|
136
|
+
The library uses Tailwind CSS for styling. Make sure your application includes Tailwind CSS configuration.
|
|
137
|
+
|
|
138
|
+
## Dependencies
|
|
139
|
+
|
|
140
|
+
Key peer dependencies:
|
|
141
|
+
- React 18.3.1+
|
|
142
|
+
- React DOM 18.3.1+
|
|
143
|
+
- @hookform/resolvers ^3.3.2
|
|
144
|
+
- react-hook-form 7.51.4
|
|
145
|
+
- lucide-react 0.456.0
|
|
146
|
+
- next-themes ^0.2.1
|
|
147
|
+
- embla-carousel ^8.1.6
|
|
148
|
+
|
|
149
|
+
## Usage Examples
|
|
150
|
+
|
|
151
|
+
### Basic Button
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import { Button } from '@hanzo/ui';
|
|
155
|
+
|
|
156
|
+
function App() {
|
|
157
|
+
return (
|
|
158
|
+
<Button variant="primary" onClick={() => console.log('clicked')}>
|
|
159
|
+
Click me
|
|
160
|
+
</Button>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Alert Dialog
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
import {
|
|
169
|
+
AlertDialog,
|
|
170
|
+
AlertDialogTrigger,
|
|
171
|
+
AlertDialogContent,
|
|
172
|
+
AlertDialogHeader,
|
|
173
|
+
AlertDialogTitle,
|
|
174
|
+
AlertDialogDescription,
|
|
175
|
+
AlertDialogFooter,
|
|
176
|
+
AlertDialogAction,
|
|
177
|
+
AlertDialogCancel
|
|
178
|
+
} from '@hanzo/ui';
|
|
179
|
+
|
|
180
|
+
function ConfirmDialog() {
|
|
181
|
+
return (
|
|
182
|
+
<AlertDialog>
|
|
183
|
+
<AlertDialogTrigger>
|
|
184
|
+
<Button>Open Dialog</Button>
|
|
185
|
+
</AlertDialogTrigger>
|
|
186
|
+
<AlertDialogContent>
|
|
187
|
+
<AlertDialogHeader>
|
|
188
|
+
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
189
|
+
<AlertDialogDescription>
|
|
190
|
+
This action cannot be undone.
|
|
191
|
+
</AlertDialogDescription>
|
|
192
|
+
</AlertDialogHeader>
|
|
193
|
+
<AlertDialogFooter>
|
|
194
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
195
|
+
<AlertDialogAction>Continue</AlertDialogAction>
|
|
196
|
+
</AlertDialogFooter>
|
|
197
|
+
</AlertDialogContent>
|
|
198
|
+
</AlertDialog>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### AI Provider Icons
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
import { OpenAIIcon, AnthropicIcon, GeminiIcon } from '@hanzo/ui/assets';
|
|
207
|
+
|
|
208
|
+
function AIProviders() {
|
|
209
|
+
return (
|
|
210
|
+
<div className="flex gap-4">
|
|
211
|
+
<OpenAIIcon className="h-6 w-6" />
|
|
212
|
+
<AnthropicIcon className="h-6 w-6" />
|
|
213
|
+
<GeminiIcon className="h-6 w-6" />
|
|
214
|
+
</div>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
BSD-3-Clause
|
|
222
|
+
|
|
223
|
+
## Author
|
|
224
|
+
|
|
225
|
+
Hanzo AI, Inc.
|
|
226
|
+
|
|
227
|
+
## Repository
|
|
228
|
+
|
|
229
|
+
https://github.com/hanzoai/react-sdk
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// AI provider icon implementations
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../src/utils';
|
|
4
|
+
import { BrainIcon, ServerIcon, BotIcon, SparklesIcon, CpuIcon, ZapIcon, RocketIcon, ActivityIcon, NetworkIcon } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
// Simple placeholder icons for AI providers - replace with actual brand icons when available
|
|
7
|
+
export const AnthropicIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
8
|
+
({ className, ...props }, ref) => (
|
|
9
|
+
<BrainIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
10
|
+
)
|
|
11
|
+
);
|
|
12
|
+
AnthropicIcon.displayName = 'AnthropicIcon';
|
|
13
|
+
|
|
14
|
+
export const AyaCohereIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
15
|
+
({ className, ...props }, ref) => (
|
|
16
|
+
<SparklesIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
AyaCohereIcon.displayName = 'AyaCohereIcon';
|
|
20
|
+
|
|
21
|
+
export const DeepSeekIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
22
|
+
({ className, ...props }, ref) => (
|
|
23
|
+
<CpuIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
DeepSeekIcon.displayName = 'DeepSeekIcon';
|
|
27
|
+
|
|
28
|
+
export const ExoIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
29
|
+
({ className, ...props }, ref) => (
|
|
30
|
+
<ServerIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
ExoIcon.displayName = 'ExoIcon';
|
|
34
|
+
|
|
35
|
+
export const GeminiIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
36
|
+
({ className, ...props }, ref) => (
|
|
37
|
+
<SparklesIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
GeminiIcon.displayName = 'GeminiIcon';
|
|
41
|
+
|
|
42
|
+
export const GoogleIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
43
|
+
({ className, ...props }, ref) => (
|
|
44
|
+
<svg ref={ref} className={cn("h-4 w-4", className)} viewBox="0 0 24 24" fill="currentColor" {...props}>
|
|
45
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
|
|
46
|
+
</svg>
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
GoogleIcon.displayName = 'GoogleIcon';
|
|
50
|
+
|
|
51
|
+
export const GrokIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
52
|
+
({ className, ...props }, ref) => (
|
|
53
|
+
<ZapIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
GrokIcon.displayName = 'GrokIcon';
|
|
57
|
+
|
|
58
|
+
export const GroqIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
59
|
+
({ className, ...props }, ref) => (
|
|
60
|
+
<RocketIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
61
|
+
)
|
|
62
|
+
);
|
|
63
|
+
GroqIcon.displayName = 'GroqIcon';
|
|
64
|
+
|
|
65
|
+
export const LmStudioIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
66
|
+
({ className, ...props }, ref) => (
|
|
67
|
+
<ServerIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
LmStudioIcon.displayName = 'LmStudioIcon';
|
|
71
|
+
|
|
72
|
+
export const MetaIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
73
|
+
({ className, ...props }, ref) => (
|
|
74
|
+
<svg ref={ref} className={cn("h-4 w-4", className)} viewBox="0 0 24 24" fill="currentColor" {...props}>
|
|
75
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8z"/>
|
|
76
|
+
</svg>
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
MetaIcon.displayName = 'MetaIcon';
|
|
80
|
+
|
|
81
|
+
export const MistralIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
82
|
+
({ className, ...props }, ref) => (
|
|
83
|
+
<ActivityIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
MistralIcon.displayName = 'MistralIcon';
|
|
87
|
+
|
|
88
|
+
export const OllamaIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
89
|
+
({ className, ...props }, ref) => (
|
|
90
|
+
<ServerIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
OllamaIcon.displayName = 'OllamaIcon';
|
|
94
|
+
|
|
95
|
+
export const OpenAIIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
96
|
+
({ className, ...props }, ref) => (
|
|
97
|
+
<BotIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
OpenAIIcon.displayName = 'OpenAIIcon';
|
|
101
|
+
|
|
102
|
+
export const OpenRouterIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
103
|
+
({ className, ...props }, ref) => (
|
|
104
|
+
<NetworkIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
OpenRouterIcon.displayName = 'OpenRouterIcon';
|
|
108
|
+
|
|
109
|
+
export const PerplexityIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
110
|
+
({ className, ...props }, ref) => (
|
|
111
|
+
<SparklesIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
PerplexityIcon.displayName = 'PerplexityIcon';
|
|
115
|
+
|
|
116
|
+
export const QwenIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
117
|
+
({ className, ...props }, ref) => (
|
|
118
|
+
<CpuIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
QwenIcon.displayName = 'QwenIcon';
|
|
122
|
+
|
|
123
|
+
export const HanzoIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
124
|
+
({ className, ...props }, ref) => (
|
|
125
|
+
<svg ref={ref} className={cn("h-4 w-4", className)} viewBox="0 0 24 24" fill="currentColor" {...props}>
|
|
126
|
+
<path d="M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z"/>
|
|
127
|
+
</svg>
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
HanzoIcon.displayName = 'HanzoIcon';
|
|
131
|
+
|
|
132
|
+
export const TogetherAI = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
133
|
+
({ className, ...props }, ref) => (
|
|
134
|
+
<NetworkIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
135
|
+
)
|
|
136
|
+
);
|
|
137
|
+
TogetherAI.displayName = 'TogetherAI';
|
|
138
|
+
|
|
139
|
+
// Generic AI icon for providers without specific icons
|
|
140
|
+
export const AisIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
141
|
+
({ className, ...props }, ref) => (
|
|
142
|
+
<BrainIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
AisIcon.displayName = 'AisIcon';
|
|
146
|
+
|
|
147
|
+
// Also export the ScheduledTasksIcon and SendIcon that might be needed
|
|
148
|
+
export const ScheduledTasksIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
149
|
+
({ className, ...props }, ref) => (
|
|
150
|
+
<ActivityIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
151
|
+
)
|
|
152
|
+
);
|
|
153
|
+
ScheduledTasksIcon.displayName = 'ScheduledTasksIcon';
|
|
154
|
+
|
|
155
|
+
export const SendIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
156
|
+
({ className, ...props }, ref) => (
|
|
157
|
+
<svg ref={ref} className={cn("h-4 w-4", className)} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" {...props}>
|
|
158
|
+
<line x1="22" y1="2" x2="11" y2="13"></line>
|
|
159
|
+
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
|
|
160
|
+
</svg>
|
|
161
|
+
)
|
|
162
|
+
);
|
|
163
|
+
SendIcon.displayName = 'SendIcon';
|
|
164
|
+
|
|
165
|
+
export const ReactJsIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
166
|
+
({ className, ...props }, ref) => (
|
|
167
|
+
<svg ref={ref} className={cn("h-4 w-4", className)} viewBox="0 0 24 24" fill="currentColor" {...props}>
|
|
168
|
+
<circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" strokeWidth="2"/>
|
|
169
|
+
<circle cx="12" cy="12" r="3" fill="currentColor"/>
|
|
170
|
+
<circle cx="12" cy="6" r="2" fill="currentColor"/>
|
|
171
|
+
<circle cx="18" cy="15" r="2" fill="currentColor"/>
|
|
172
|
+
<circle cx="6" cy="15" r="2" fill="currentColor"/>
|
|
173
|
+
<path d="M12 12 L12 6 M12 12 L18 15 M12 12 L6 15" stroke="currentColor" strokeWidth="1.5"/>
|
|
174
|
+
</svg>
|
|
175
|
+
)
|
|
176
|
+
);
|
|
177
|
+
ReactJsIcon.displayName = 'ReactJsIcon';
|
|
178
|
+
|
|
179
|
+
export const ReasoningIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
180
|
+
({ className, ...props }, ref) => (
|
|
181
|
+
<BrainIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
182
|
+
)
|
|
183
|
+
);
|
|
184
|
+
ReasoningIcon.displayName = 'ReasoningIcon';
|
|
185
|
+
|
|
186
|
+
export const ToolsIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
187
|
+
({ className, ...props }, ref) => (
|
|
188
|
+
<svg ref={ref} className={cn("h-4 w-4", className)} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" {...props}>
|
|
189
|
+
<path d="M14 2l1.5 1.5v5.5L21 9v6l-5.5-.5V21L14 22l-2-7-2 7-1.5-1V14.5L3 15V9l5.5.5V4L10 2h4z"/>
|
|
190
|
+
</svg>
|
|
191
|
+
)
|
|
192
|
+
);
|
|
193
|
+
ToolsIcon.displayName = 'ToolsIcon';
|
|
194
|
+
|
|
195
|
+
export const AIAgentIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
196
|
+
({ className, ...props }, ref) => (
|
|
197
|
+
<BotIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
198
|
+
)
|
|
199
|
+
);
|
|
200
|
+
AIAgentIcon.displayName = 'AIAgentIcon';
|
|
201
|
+
|
|
202
|
+
export const TracingIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(
|
|
203
|
+
({ className, ...props }, ref) => (
|
|
204
|
+
<ActivityIcon ref={ref} className={cn("h-4 w-4", className)} {...props} />
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
TracingIcon.displayName = 'TracingIcon';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn } from '../src/utils';
|
|
2
|
+
|
|
3
|
+
export const EthereumIcon = ({ className }: { className?: string }) => (
|
|
4
|
+
<svg
|
|
5
|
+
className={cn('shrink-0', className)}
|
|
6
|
+
width="16"
|
|
7
|
+
height="16"
|
|
8
|
+
fill="none"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
fill="#fff"
|
|
13
|
+
d="M12 3v6.65l5.625 2.516zm0 0-5.625 9.166L12 9.651zm0 13.477v4.522l5.625-7.784zM12 21v-4.523l-5.625-3.262z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const USDCIcon = ({ className }: { className?: string }) => (
|
|
19
|
+
<svg
|
|
20
|
+
width="16"
|
|
21
|
+
className={cn('shrink-0', className)}
|
|
22
|
+
height="16"
|
|
23
|
+
fill="none"
|
|
24
|
+
viewBox="0 0 24 24"
|
|
25
|
+
>
|
|
26
|
+
<path
|
|
27
|
+
fill="#fff"
|
|
28
|
+
fillRule="evenodd"
|
|
29
|
+
d="M12 21c4.99 0 9-4.01 9-9s-4.01-9-9-9-9 4.01-9 9 4.01 9 9 9m2.475-7.578c0-1.31-.787-1.76-2.362-1.946-1.125-.152-1.35-.45-1.35-.978 0-.523.377-.86 1.125-.86.675 0 1.052.224 1.237.787.04.112.152.185.265.185h.596a.256.256 0 0 0 .264-.259v-.039c-.152-.827-.827-1.614-1.687-1.687v-.827c0-.152-.113-.265-.298-.298h-.495c-.152 0-.293.112-.332.298v.827c-1.125.151-1.873 1.012-1.873 1.951 0 1.238.748 1.722 2.323 1.913 1.052.185 1.39.41 1.39 1.012 0 .597-.53 1.013-1.238 1.013-.98 0-1.316-.416-1.429-.979-.034-.146-.146-.225-.259-.225h-.641a.256.256 0 0 0-.259.264v.04c.146.934.748 1.575 1.986 1.76v.833c0 .152.112.253.298.293h.54c.146 0 .248-.102.287-.293v-.833c1.125-.185 1.912-.939 1.912-1.952"
|
|
30
|
+
clipRule="evenodd"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// FileTypeIcon component
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../src/utils';
|
|
4
|
+
import { FileIcon, FolderIcon, ImageIcon, FileTextIcon, FileCodeIcon, FileArchiveIcon } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
export interface FileTypeIconProps extends React.SVGProps<SVGSVGElement> {
|
|
7
|
+
type?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const getIconForType = (type?: string) => {
|
|
11
|
+
if (!type) return FileIcon;
|
|
12
|
+
|
|
13
|
+
const lowerType = type.toLowerCase();
|
|
14
|
+
|
|
15
|
+
// Image files
|
|
16
|
+
if (['png', 'jpg', 'jpeg', 'gif', 'svg', 'webp', 'ico', 'bmp'].includes(lowerType)) {
|
|
17
|
+
return ImageIcon;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Document files
|
|
21
|
+
if (['pdf', 'doc', 'docx', 'txt', 'md', 'rtf'].includes(lowerType)) {
|
|
22
|
+
return FileTextIcon;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Code files
|
|
26
|
+
if (['js', 'jsx', 'ts', 'tsx', 'html', 'css', 'scss', 'json', 'xml', 'py', 'java', 'c', 'cpp', 'rs', 'go'].includes(lowerType)) {
|
|
27
|
+
return FileCodeIcon;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Archive files
|
|
31
|
+
if (['zip', 'rar', '7z', 'tar', 'gz', 'bz2', 'xz'].includes(lowerType)) {
|
|
32
|
+
return FileArchiveIcon;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return FileIcon;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const FileTypeIcon = React.forwardRef<SVGSVGElement, FileTypeIconProps>(
|
|
39
|
+
({ type, className, ...props }, ref) => {
|
|
40
|
+
const Icon = getIconForType(type);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Icon
|
|
44
|
+
ref={ref}
|
|
45
|
+
className={cn("h-4 w-4", className)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
FileTypeIcon.displayName = 'FileTypeIcon';
|
|
53
|
+
|
|
54
|
+
export const DirectoryTypeIcon = React.forwardRef<SVGSVGElement, Omit<FileTypeIconProps, 'type'>>(
|
|
55
|
+
({ className, ...props }, ref) => {
|
|
56
|
+
return (
|
|
57
|
+
<FolderIcon
|
|
58
|
+
ref={ref}
|
|
59
|
+
className={cn("h-4 w-4", className)}
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
DirectoryTypeIcon.displayName = 'DirectoryTypeIcon';
|
package/assets/file.tsx
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// File icon map - placeholder for now
|
|
2
|
+
// TODO: Add actual file icons when SVG assets are available
|
|
3
|
+
|
|
4
|
+
export const fileIconMap: Record<string, string> = {
|
|
5
|
+
aep: '',
|
|
6
|
+
ai: '',
|
|
7
|
+
avi: '',
|
|
8
|
+
css: '',
|
|
9
|
+
csv: '',
|
|
10
|
+
dmg: '',
|
|
11
|
+
doc: '',
|
|
12
|
+
docx: '',
|
|
13
|
+
gif: '',
|
|
14
|
+
html: '',
|
|
15
|
+
jpeg: '',
|
|
16
|
+
jpg: '',
|
|
17
|
+
js: '',
|
|
18
|
+
json: '',
|
|
19
|
+
pdf: '',
|
|
20
|
+
png: '',
|
|
21
|
+
ppt: '',
|
|
22
|
+
pptx: '',
|
|
23
|
+
psd: '',
|
|
24
|
+
svg: '',
|
|
25
|
+
xls: '',
|
|
26
|
+
xlsx: '',
|
|
27
|
+
xml: '',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const PaperClipIcon = ({ className }: { className?: string }) => (
|
|
31
|
+
<svg
|
|
32
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
33
|
+
fill="none"
|
|
34
|
+
viewBox="0 0 24 24"
|
|
35
|
+
strokeWidth={1.5}
|
|
36
|
+
stroke="currentColor"
|
|
37
|
+
className={className}
|
|
38
|
+
>
|
|
39
|
+
<path
|
|
40
|
+
strokeLinecap="round"
|
|
41
|
+
strokeLinejoin="round"
|
|
42
|
+
d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
);
|