@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/dist/registry/index.d.ts
CHANGED
|
@@ -1,8 +1,352 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const fileSchema:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export declare const fileSchema: z.ZodObject<{
|
|
3
|
+
path: z.ZodString;
|
|
4
|
+
content: z.ZodOptional<z.ZodString>;
|
|
5
|
+
type: z.ZodString;
|
|
6
|
+
target: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
type: string;
|
|
9
|
+
path: string;
|
|
10
|
+
content?: string | undefined;
|
|
11
|
+
target?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
type: string;
|
|
14
|
+
path: string;
|
|
15
|
+
content?: string | undefined;
|
|
16
|
+
target?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const registryItemSchema: z.ZodObject<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
type: z.ZodString;
|
|
21
|
+
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
author: z.ZodOptional<z.ZodString>;
|
|
23
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
devDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
25
|
+
registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
27
|
+
path: z.ZodString;
|
|
28
|
+
content: z.ZodOptional<z.ZodString>;
|
|
29
|
+
type: z.ZodString;
|
|
30
|
+
target: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
type: string;
|
|
33
|
+
path: string;
|
|
34
|
+
content?: string | undefined;
|
|
35
|
+
target?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
type: string;
|
|
38
|
+
path: string;
|
|
39
|
+
content?: string | undefined;
|
|
40
|
+
target?: string | undefined;
|
|
41
|
+
}>, "many">>;
|
|
42
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
43
|
+
title: z.ZodOptional<z.ZodString>;
|
|
44
|
+
cssVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
45
|
+
tailwind: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
46
|
+
category: z.ZodOptional<z.ZodString>;
|
|
47
|
+
subcategory: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
title?: string | undefined;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
author?: string | undefined;
|
|
54
|
+
dependencies?: string[] | undefined;
|
|
55
|
+
devDependencies?: string[] | undefined;
|
|
56
|
+
registryDependencies?: string[] | undefined;
|
|
57
|
+
files?: {
|
|
58
|
+
type: string;
|
|
59
|
+
path: string;
|
|
60
|
+
content?: string | undefined;
|
|
61
|
+
target?: string | undefined;
|
|
62
|
+
}[] | undefined;
|
|
63
|
+
meta?: Record<string, any> | undefined;
|
|
64
|
+
cssVars?: Record<string, any> | undefined;
|
|
65
|
+
tailwind?: Record<string, any> | undefined;
|
|
66
|
+
category?: string | undefined;
|
|
67
|
+
subcategory?: string | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
name: string;
|
|
70
|
+
type: string;
|
|
71
|
+
title?: string | undefined;
|
|
72
|
+
description?: string | undefined;
|
|
73
|
+
author?: string | undefined;
|
|
74
|
+
dependencies?: string[] | undefined;
|
|
75
|
+
devDependencies?: string[] | undefined;
|
|
76
|
+
registryDependencies?: string[] | undefined;
|
|
77
|
+
files?: {
|
|
78
|
+
type: string;
|
|
79
|
+
path: string;
|
|
80
|
+
content?: string | undefined;
|
|
81
|
+
target?: string | undefined;
|
|
82
|
+
}[] | undefined;
|
|
83
|
+
meta?: Record<string, any> | undefined;
|
|
84
|
+
cssVars?: Record<string, any> | undefined;
|
|
85
|
+
tailwind?: Record<string, any> | undefined;
|
|
86
|
+
category?: string | undefined;
|
|
87
|
+
subcategory?: string | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export declare const registrySchema: z.ZodObject<{
|
|
90
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
93
|
+
style: z.ZodOptional<z.ZodString>;
|
|
94
|
+
items: z.ZodArray<z.ZodObject<{
|
|
95
|
+
name: z.ZodString;
|
|
96
|
+
type: z.ZodString;
|
|
97
|
+
description: z.ZodOptional<z.ZodString>;
|
|
98
|
+
author: z.ZodOptional<z.ZodString>;
|
|
99
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
100
|
+
devDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
101
|
+
registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
102
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
103
|
+
path: z.ZodString;
|
|
104
|
+
content: z.ZodOptional<z.ZodString>;
|
|
105
|
+
type: z.ZodString;
|
|
106
|
+
target: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
type: string;
|
|
109
|
+
path: string;
|
|
110
|
+
content?: string | undefined;
|
|
111
|
+
target?: string | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
type: string;
|
|
114
|
+
path: string;
|
|
115
|
+
content?: string | undefined;
|
|
116
|
+
target?: string | undefined;
|
|
117
|
+
}>, "many">>;
|
|
118
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
119
|
+
title: z.ZodOptional<z.ZodString>;
|
|
120
|
+
cssVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
121
|
+
tailwind: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
122
|
+
category: z.ZodOptional<z.ZodString>;
|
|
123
|
+
subcategory: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
name: string;
|
|
126
|
+
type: string;
|
|
127
|
+
title?: string | undefined;
|
|
128
|
+
description?: string | undefined;
|
|
129
|
+
author?: string | undefined;
|
|
130
|
+
dependencies?: string[] | undefined;
|
|
131
|
+
devDependencies?: string[] | undefined;
|
|
132
|
+
registryDependencies?: string[] | undefined;
|
|
133
|
+
files?: {
|
|
134
|
+
type: string;
|
|
135
|
+
path: string;
|
|
136
|
+
content?: string | undefined;
|
|
137
|
+
target?: string | undefined;
|
|
138
|
+
}[] | undefined;
|
|
139
|
+
meta?: Record<string, any> | undefined;
|
|
140
|
+
cssVars?: Record<string, any> | undefined;
|
|
141
|
+
tailwind?: Record<string, any> | undefined;
|
|
142
|
+
category?: string | undefined;
|
|
143
|
+
subcategory?: string | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
name: string;
|
|
146
|
+
type: string;
|
|
147
|
+
title?: string | undefined;
|
|
148
|
+
description?: string | undefined;
|
|
149
|
+
author?: string | undefined;
|
|
150
|
+
dependencies?: string[] | undefined;
|
|
151
|
+
devDependencies?: string[] | undefined;
|
|
152
|
+
registryDependencies?: string[] | undefined;
|
|
153
|
+
files?: {
|
|
154
|
+
type: string;
|
|
155
|
+
path: string;
|
|
156
|
+
content?: string | undefined;
|
|
157
|
+
target?: string | undefined;
|
|
158
|
+
}[] | undefined;
|
|
159
|
+
meta?: Record<string, any> | undefined;
|
|
160
|
+
cssVars?: Record<string, any> | undefined;
|
|
161
|
+
tailwind?: Record<string, any> | undefined;
|
|
162
|
+
category?: string | undefined;
|
|
163
|
+
subcategory?: string | undefined;
|
|
164
|
+
}>, "many">;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
name: string;
|
|
167
|
+
items: {
|
|
168
|
+
name: string;
|
|
169
|
+
type: string;
|
|
170
|
+
title?: string | undefined;
|
|
171
|
+
description?: string | undefined;
|
|
172
|
+
author?: string | undefined;
|
|
173
|
+
dependencies?: string[] | undefined;
|
|
174
|
+
devDependencies?: string[] | undefined;
|
|
175
|
+
registryDependencies?: string[] | undefined;
|
|
176
|
+
files?: {
|
|
177
|
+
type: string;
|
|
178
|
+
path: string;
|
|
179
|
+
content?: string | undefined;
|
|
180
|
+
target?: string | undefined;
|
|
181
|
+
}[] | undefined;
|
|
182
|
+
meta?: Record<string, any> | undefined;
|
|
183
|
+
cssVars?: Record<string, any> | undefined;
|
|
184
|
+
tailwind?: Record<string, any> | undefined;
|
|
185
|
+
category?: string | undefined;
|
|
186
|
+
subcategory?: string | undefined;
|
|
187
|
+
}[];
|
|
188
|
+
style?: string | undefined;
|
|
189
|
+
$schema?: string | undefined;
|
|
190
|
+
homepage?: string | undefined;
|
|
191
|
+
}, {
|
|
192
|
+
name: string;
|
|
193
|
+
items: {
|
|
194
|
+
name: string;
|
|
195
|
+
type: string;
|
|
196
|
+
title?: string | undefined;
|
|
197
|
+
description?: string | undefined;
|
|
198
|
+
author?: string | undefined;
|
|
199
|
+
dependencies?: string[] | undefined;
|
|
200
|
+
devDependencies?: string[] | undefined;
|
|
201
|
+
registryDependencies?: string[] | undefined;
|
|
202
|
+
files?: {
|
|
203
|
+
type: string;
|
|
204
|
+
path: string;
|
|
205
|
+
content?: string | undefined;
|
|
206
|
+
target?: string | undefined;
|
|
207
|
+
}[] | undefined;
|
|
208
|
+
meta?: Record<string, any> | undefined;
|
|
209
|
+
cssVars?: Record<string, any> | undefined;
|
|
210
|
+
tailwind?: Record<string, any> | undefined;
|
|
211
|
+
category?: string | undefined;
|
|
212
|
+
subcategory?: string | undefined;
|
|
213
|
+
}[];
|
|
214
|
+
style?: string | undefined;
|
|
215
|
+
$schema?: string | undefined;
|
|
216
|
+
homepage?: string | undefined;
|
|
217
|
+
}>;
|
|
218
|
+
export declare const registryWithContentSchema: z.ZodObject<{
|
|
219
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
222
|
+
style: z.ZodOptional<z.ZodString>;
|
|
223
|
+
} & {
|
|
224
|
+
items: z.ZodArray<z.ZodObject<{
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
type: z.ZodString;
|
|
227
|
+
description: z.ZodOptional<z.ZodString>;
|
|
228
|
+
author: z.ZodOptional<z.ZodString>;
|
|
229
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
230
|
+
devDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
231
|
+
registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
232
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
233
|
+
title: z.ZodOptional<z.ZodString>;
|
|
234
|
+
cssVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
235
|
+
tailwind: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
236
|
+
category: z.ZodOptional<z.ZodString>;
|
|
237
|
+
subcategory: z.ZodOptional<z.ZodString>;
|
|
238
|
+
} & {
|
|
239
|
+
files: z.ZodArray<z.ZodObject<{
|
|
240
|
+
path: z.ZodString;
|
|
241
|
+
type: z.ZodString;
|
|
242
|
+
target: z.ZodOptional<z.ZodString>;
|
|
243
|
+
} & {
|
|
244
|
+
content: z.ZodString;
|
|
245
|
+
}, "strip", z.ZodTypeAny, {
|
|
246
|
+
type: string;
|
|
247
|
+
content: string;
|
|
248
|
+
path: string;
|
|
249
|
+
target?: string | undefined;
|
|
250
|
+
}, {
|
|
251
|
+
type: string;
|
|
252
|
+
content: string;
|
|
253
|
+
path: string;
|
|
254
|
+
target?: string | undefined;
|
|
255
|
+
}>, "many">;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
name: string;
|
|
258
|
+
type: string;
|
|
259
|
+
files: {
|
|
260
|
+
type: string;
|
|
261
|
+
content: string;
|
|
262
|
+
path: string;
|
|
263
|
+
target?: string | undefined;
|
|
264
|
+
}[];
|
|
265
|
+
title?: string | undefined;
|
|
266
|
+
description?: string | undefined;
|
|
267
|
+
author?: string | undefined;
|
|
268
|
+
dependencies?: string[] | undefined;
|
|
269
|
+
devDependencies?: string[] | undefined;
|
|
270
|
+
registryDependencies?: string[] | undefined;
|
|
271
|
+
meta?: Record<string, any> | undefined;
|
|
272
|
+
cssVars?: Record<string, any> | undefined;
|
|
273
|
+
tailwind?: Record<string, any> | undefined;
|
|
274
|
+
category?: string | undefined;
|
|
275
|
+
subcategory?: string | undefined;
|
|
276
|
+
}, {
|
|
277
|
+
name: string;
|
|
278
|
+
type: string;
|
|
279
|
+
files: {
|
|
280
|
+
type: string;
|
|
281
|
+
content: string;
|
|
282
|
+
path: string;
|
|
283
|
+
target?: string | undefined;
|
|
284
|
+
}[];
|
|
285
|
+
title?: string | undefined;
|
|
286
|
+
description?: string | undefined;
|
|
287
|
+
author?: string | undefined;
|
|
288
|
+
dependencies?: string[] | undefined;
|
|
289
|
+
devDependencies?: string[] | undefined;
|
|
290
|
+
registryDependencies?: string[] | undefined;
|
|
291
|
+
meta?: Record<string, any> | undefined;
|
|
292
|
+
cssVars?: Record<string, any> | undefined;
|
|
293
|
+
tailwind?: Record<string, any> | undefined;
|
|
294
|
+
category?: string | undefined;
|
|
295
|
+
subcategory?: string | undefined;
|
|
296
|
+
}>, "many">;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
name: string;
|
|
299
|
+
items: {
|
|
300
|
+
name: string;
|
|
301
|
+
type: string;
|
|
302
|
+
files: {
|
|
303
|
+
type: string;
|
|
304
|
+
content: string;
|
|
305
|
+
path: string;
|
|
306
|
+
target?: string | undefined;
|
|
307
|
+
}[];
|
|
308
|
+
title?: string | undefined;
|
|
309
|
+
description?: string | undefined;
|
|
310
|
+
author?: string | undefined;
|
|
311
|
+
dependencies?: string[] | undefined;
|
|
312
|
+
devDependencies?: string[] | undefined;
|
|
313
|
+
registryDependencies?: string[] | undefined;
|
|
314
|
+
meta?: Record<string, any> | undefined;
|
|
315
|
+
cssVars?: Record<string, any> | undefined;
|
|
316
|
+
tailwind?: Record<string, any> | undefined;
|
|
317
|
+
category?: string | undefined;
|
|
318
|
+
subcategory?: string | undefined;
|
|
319
|
+
}[];
|
|
320
|
+
style?: string | undefined;
|
|
321
|
+
$schema?: string | undefined;
|
|
322
|
+
homepage?: string | undefined;
|
|
323
|
+
}, {
|
|
324
|
+
name: string;
|
|
325
|
+
items: {
|
|
326
|
+
name: string;
|
|
327
|
+
type: string;
|
|
328
|
+
files: {
|
|
329
|
+
type: string;
|
|
330
|
+
content: string;
|
|
331
|
+
path: string;
|
|
332
|
+
target?: string | undefined;
|
|
333
|
+
}[];
|
|
334
|
+
title?: string | undefined;
|
|
335
|
+
description?: string | undefined;
|
|
336
|
+
author?: string | undefined;
|
|
337
|
+
dependencies?: string[] | undefined;
|
|
338
|
+
devDependencies?: string[] | undefined;
|
|
339
|
+
registryDependencies?: string[] | undefined;
|
|
340
|
+
meta?: Record<string, any> | undefined;
|
|
341
|
+
cssVars?: Record<string, any> | undefined;
|
|
342
|
+
tailwind?: Record<string, any> | undefined;
|
|
343
|
+
category?: string | undefined;
|
|
344
|
+
subcategory?: string | undefined;
|
|
345
|
+
}[];
|
|
346
|
+
style?: string | undefined;
|
|
347
|
+
$schema?: string | undefined;
|
|
348
|
+
homepage?: string | undefined;
|
|
349
|
+
}>;
|
|
6
350
|
export type RegistryItem = z.infer<typeof registryItemSchema>;
|
|
7
351
|
export type Registry = z.infer<typeof registrySchema>;
|
|
8
352
|
export type RegistryWithContent = z.infer<typeof registryWithContentSchema>;
|
package/dist/registry/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
// Define the file schema to match
|
|
2
|
+
// Define the file schema to match hanzo/ui's format
|
|
3
3
|
export const fileSchema = z.object({
|
|
4
4
|
path: z.string(),
|
|
5
5
|
content: z.string().optional(),
|
|
6
6
|
type: z.string(),
|
|
7
7
|
target: z.string().optional(),
|
|
8
8
|
});
|
|
9
|
-
// Registry item schema aligned with
|
|
9
|
+
// Registry item schema aligned with hanzo/ui format
|
|
10
10
|
export const registryItemSchema = z.object({
|
|
11
11
|
name: z.string(),
|
|
12
12
|
type: z.string(),
|
|
@@ -23,7 +23,7 @@ export const registryItemSchema = z.object({
|
|
|
23
23
|
category: z.string().optional(),
|
|
24
24
|
subcategory: z.string().optional(),
|
|
25
25
|
});
|
|
26
|
-
// Registry schema aligned with
|
|
26
|
+
// Registry schema aligned with hanzo/ui format
|
|
27
27
|
export const registrySchema = z.object({
|
|
28
28
|
$schema: z.string().optional(),
|
|
29
29
|
name: z.string(),
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../app/lib/utils';
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../app/lib/utils';
|
package/helpers/file.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const getFileExt = (fileName: string): string => {
|
|
2
|
+
if (!fileName) return '';
|
|
3
|
+
const parts = fileName.split('.');
|
|
4
|
+
return parts.length > 1 ? parts[parts.length - 1].toLowerCase() : '';
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const formatFileSize = (bytes: number): string => {
|
|
8
|
+
if (bytes === 0) return '0 Bytes';
|
|
9
|
+
const k = 1024;
|
|
10
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
11
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
12
|
+
return Math.round(bytes / Math.pow(k, i) * 100) / 100 + ' ' + sizes[i];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const isImageFile = (fileName: string): boolean => {
|
|
16
|
+
const ext = getFileExt(fileName);
|
|
17
|
+
return ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp'].includes(ext);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const isPdfFile = (fileName: string): boolean => {
|
|
21
|
+
const ext = getFileExt(fileName);
|
|
22
|
+
return ext === 'pdf';
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const isVideoFile = (fileName: string): boolean => {
|
|
26
|
+
const ext = getFileExt(fileName);
|
|
27
|
+
return ['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv', 'webm'].includes(ext);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const isAudioFile = (fileName: string): boolean => {
|
|
31
|
+
const ext = getFileExt(fileName);
|
|
32
|
+
return ['mp3', 'wav', 'ogg', 'aac', 'flac', 'wma'].includes(ext);
|
|
33
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// Memoization helpers for markdown components
|
|
4
|
+
export const memoCompareNodes = (
|
|
5
|
+
prevProps: { children?: React.ReactNode },
|
|
6
|
+
nextProps: { children?: React.ReactNode }
|
|
7
|
+
): boolean => {
|
|
8
|
+
return prevProps.children === nextProps.children;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const memoizeMarkdownComponents = <T extends Record<string, React.ComponentType<any>>>(
|
|
12
|
+
components: T
|
|
13
|
+
): T => {
|
|
14
|
+
const memoized: any = {};
|
|
15
|
+
|
|
16
|
+
for (const key in components) {
|
|
17
|
+
if (components.hasOwnProperty(key)) {
|
|
18
|
+
memoized[key] = React.memo(components[key]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return memoized as T;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Helper to check if props are equal for memoization
|
|
26
|
+
export const arePropsEqual = <T extends Record<string, any>>(
|
|
27
|
+
prevProps: T,
|
|
28
|
+
nextProps: T,
|
|
29
|
+
keys?: string[]
|
|
30
|
+
): boolean => {
|
|
31
|
+
const keysToCheck = keys || Object.keys(prevProps);
|
|
32
|
+
|
|
33
|
+
for (const key of keysToCheck) {
|
|
34
|
+
if (prevProps[key] !== nextProps[key]) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return true;
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "Library that contains shared UI primitives, support for a common design system, and other boilerplate support.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -42,18 +42,27 @@
|
|
|
42
42
|
"hanzo-ui": "./bin/cli.js"
|
|
43
43
|
},
|
|
44
44
|
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"import": "./primitives/index-next.ts",
|
|
47
|
+
"require": "./primitives/index-common.ts",
|
|
48
|
+
"default": "./primitives/index-next.ts"
|
|
49
|
+
},
|
|
50
|
+
"./assets": "./assets/index.ts",
|
|
45
51
|
"./blocks": "./blocks/index.ts",
|
|
52
|
+
"./components": "./components/index.ts",
|
|
46
53
|
"./primitives": "./primitives/index-next.ts",
|
|
47
54
|
"./primitives-common": "./primitives/index-common.ts",
|
|
48
55
|
"./registry": {
|
|
49
56
|
"types": "./dist/registry/index.d.ts",
|
|
50
57
|
"default": "./dist/registry/index.js"
|
|
51
58
|
},
|
|
52
|
-
"./style
|
|
59
|
+
"./style/*": "./style/*",
|
|
53
60
|
"./tailwind": "./tailwind/index.ts",
|
|
54
61
|
"./types": "./types/index.ts",
|
|
55
62
|
"./util": "./util/index.ts",
|
|
56
63
|
"./util-client": "./util/index-client.ts",
|
|
64
|
+
"./utils": "./src/utils.ts",
|
|
65
|
+
"./lib/utils": "./src/utils.ts",
|
|
57
66
|
"./mcp": {
|
|
58
67
|
"types": "./dist/mcp/index.d.ts",
|
|
59
68
|
"default": "./dist/mcp/index.js"
|
|
@@ -64,11 +73,15 @@
|
|
|
64
73
|
"@modelcontextprotocol/sdk": "^1.10.2",
|
|
65
74
|
"@next/third-parties": "^15.0.1",
|
|
66
75
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
76
|
+
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
67
77
|
"@radix-ui/react-aspect-ratio": "^1.0.3",
|
|
68
78
|
"@radix-ui/react-avatar": "^1.0.3",
|
|
69
79
|
"@radix-ui/react-checkbox": "^1.0.4",
|
|
80
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
70
81
|
"@radix-ui/react-context-menu": "^2.2.2",
|
|
71
82
|
"@radix-ui/react-dialog": "^1.0.5",
|
|
83
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
84
|
+
"@radix-ui/react-hover-card": "^1.1.15",
|
|
72
85
|
"@radix-ui/react-icons": "^1.3.0",
|
|
73
86
|
"@radix-ui/react-label": "^2.0.2",
|
|
74
87
|
"@radix-ui/react-navigation-menu": "^1.1.3",
|
|
@@ -86,26 +99,34 @@
|
|
|
86
99
|
"@radix-ui/react-toggle": "^1.0.3",
|
|
87
100
|
"@radix-ui/react-toggle-group": "^1.0.4",
|
|
88
101
|
"@radix-ui/react-tooltip": "^1.0.6",
|
|
102
|
+
"@radix-ui/react-use-callback-ref": "^1.1.1",
|
|
89
103
|
"@splinetool/react-spline": "^4.0.0",
|
|
90
104
|
"@splinetool/runtime": "^1.9.35",
|
|
91
105
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
92
|
-
"class-variance-authority": "^0.7.
|
|
93
|
-
"clsx": "^2.1.
|
|
106
|
+
"class-variance-authority": "^0.7.1",
|
|
107
|
+
"clsx": "^2.1.1",
|
|
94
108
|
"cmdk": "^0.2.0",
|
|
95
109
|
"commander": "^12.1.0",
|
|
110
|
+
"date-fns": "^4.1.0",
|
|
96
111
|
"embla-carousel-react": "8.5.1",
|
|
97
112
|
"input-otp": "^1.0.1",
|
|
98
113
|
"lodash.castarray": "^4.4.0",
|
|
99
114
|
"lodash.isplainobject": "^4.0.6",
|
|
100
115
|
"lodash.merge": "^4.6.2",
|
|
101
|
-
"markdown-to-jsx": "^7.
|
|
116
|
+
"markdown-to-jsx": "^7.7.13",
|
|
117
|
+
"mermaid": "^11.12.0",
|
|
102
118
|
"postcss-selector-parser": "^6.0.16",
|
|
119
|
+
"qrcode.react": "^4.2.0",
|
|
103
120
|
"react-day-picker": "^8.10.1",
|
|
104
121
|
"react-intersection-observer": "^9.8.2",
|
|
122
|
+
"react-resizable-panels": "^3.0.6",
|
|
105
123
|
"sonner": "^1.4.41",
|
|
106
|
-
"
|
|
124
|
+
"sql.js": "^1.13.0",
|
|
125
|
+
"svg-pan-zoom": "^3.6.2",
|
|
126
|
+
"tailwind-merge": "^2.6.0",
|
|
107
127
|
"tailwindcss-animate": "^1.0.7",
|
|
108
128
|
"tailwindcss-interaction-media": "^0.1.0",
|
|
129
|
+
"vaul": "^1.1.2",
|
|
109
130
|
"zod": "^3.23.8",
|
|
110
131
|
"zod-to-json-schema": "^3.23.2"
|
|
111
132
|
},
|
package/primitives/accordion.tsx
CHANGED
|
@@ -1,66 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
+
import { ChevronDown } from 'lucide-react';
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
|
|
4
|
-
import
|
|
5
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
6
|
-
import { ChevronDown } from "lucide-react"
|
|
5
|
+
import { cn } from '../src/utils';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
const Accordion = AccordionPrimitive.Root;
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
type AccordionItemProps = React.ComponentPropsWithoutRef<
|
|
10
|
+
typeof AccordionPrimitive.Item
|
|
11
|
+
> & {
|
|
12
|
+
ref?: React.RefObject<React.ComponentRef<typeof AccordionPrimitive.Item>>;
|
|
13
|
+
};
|
|
11
14
|
|
|
12
|
-
const AccordionItem =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<AccordionPrimitive.Item
|
|
17
|
-
ref={ref}
|
|
18
|
-
className={cn("border-b", className)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
))
|
|
22
|
-
AccordionItem.displayName = "AccordionItem"
|
|
15
|
+
const AccordionItem = ({ className, ref, ...props }: AccordionItemProps) => (
|
|
16
|
+
<AccordionPrimitive.Item className={cn('', className)} ref={ref} {...props} />
|
|
17
|
+
);
|
|
18
|
+
AccordionItem.displayName = 'AccordionItem';
|
|
23
19
|
|
|
24
|
-
type AccordionTriggerProps = React.ComponentPropsWithoutRef<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
type AccordionTriggerProps = React.ComponentPropsWithoutRef<
|
|
21
|
+
typeof AccordionPrimitive.Trigger
|
|
22
|
+
> & {
|
|
23
|
+
hideArrow?: boolean;
|
|
24
|
+
ref?: React.RefObject<React.ComponentRef<typeof AccordionPrimitive.Trigger>>;
|
|
25
|
+
};
|
|
28
26
|
|
|
29
|
-
const AccordionTrigger =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
const AccordionTrigger = ({
|
|
28
|
+
className,
|
|
29
|
+
children,
|
|
30
|
+
hideArrow = false,
|
|
31
|
+
ref,
|
|
32
|
+
...props
|
|
33
|
+
}: AccordionTriggerProps) => (
|
|
34
|
+
<AccordionPrimitive.Header className="flex">
|
|
34
35
|
<AccordionPrimitive.Trigger
|
|
35
|
-
ref={ref}
|
|
36
36
|
className={cn(
|
|
37
|
-
|
|
38
|
-
className
|
|
37
|
+
'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
|
|
38
|
+
className,
|
|
39
39
|
)}
|
|
40
|
+
ref={ref}
|
|
40
41
|
{...props}
|
|
41
42
|
>
|
|
42
43
|
{children}
|
|
43
|
-
{
|
|
44
|
+
{hideArrow ? null : (
|
|
45
|
+
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
46
|
+
)}
|
|
44
47
|
</AccordionPrimitive.Trigger>
|
|
45
48
|
</AccordionPrimitive.Header>
|
|
46
|
-
)
|
|
47
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
49
|
+
);
|
|
50
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
51
|
+
|
|
52
|
+
type AccordionContentProps = React.ComponentPropsWithoutRef<
|
|
53
|
+
typeof AccordionPrimitive.Content
|
|
54
|
+
> & {
|
|
55
|
+
ref?: React.RefObject<React.ComponentRef<typeof AccordionPrimitive.Content>>;
|
|
56
|
+
};
|
|
48
57
|
|
|
49
|
-
const AccordionContent =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
const AccordionContent = ({
|
|
59
|
+
className,
|
|
60
|
+
children,
|
|
61
|
+
ref,
|
|
62
|
+
...props
|
|
63
|
+
}: AccordionContentProps) => (
|
|
53
64
|
<AccordionPrimitive.Content
|
|
65
|
+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down w-full overflow-hidden text-sm transition-all"
|
|
54
66
|
ref={ref}
|
|
55
|
-
className={cn(
|
|
56
|
-
"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
57
|
-
className
|
|
58
|
-
)}
|
|
59
67
|
{...props}
|
|
60
68
|
>
|
|
61
|
-
<div className=
|
|
69
|
+
<div className={cn('pt-0 pb-4', className)}>{children}</div>
|
|
62
70
|
</AccordionPrimitive.Content>
|
|
63
|
-
)
|
|
64
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
71
|
+
);
|
|
72
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
65
73
|
|
|
66
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
74
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|