@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/primitives/form.jsx
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
-
import { Controller, FormProvider, useFormContext, } from "react-hook-form";
|
|
6
|
-
import { cn } from "../util";
|
|
7
|
-
import Label from "./label";
|
|
8
|
-
const Form = FormProvider;
|
|
9
|
-
const FormFieldContext = React.createContext({});
|
|
10
|
-
const FormField = ({ ...props }) => {
|
|
11
|
-
return (<FormFieldContext.Provider value={{ name: props.name }}>
|
|
12
|
-
<Controller {...props}/>
|
|
13
|
-
</FormFieldContext.Provider>);
|
|
14
|
-
};
|
|
15
|
-
const useFormField = () => {
|
|
16
|
-
const fieldContext = React.useContext(FormFieldContext);
|
|
17
|
-
const itemContext = React.useContext(FormItemContext);
|
|
18
|
-
const { getFieldState, formState } = useFormContext();
|
|
19
|
-
const fieldState = getFieldState(fieldContext.name, formState);
|
|
20
|
-
if (!fieldContext) {
|
|
21
|
-
throw new Error("useFormField should be used within <FormField>");
|
|
22
|
-
}
|
|
23
|
-
const { id } = itemContext;
|
|
24
|
-
return {
|
|
25
|
-
id,
|
|
26
|
-
name: fieldContext.name,
|
|
27
|
-
formItemId: `${id}-form-item`,
|
|
28
|
-
formDescriptionId: `${id}-form-item-description`,
|
|
29
|
-
formMessageId: `${id}-form-item-message`,
|
|
30
|
-
...fieldState,
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
const FormItemContext = React.createContext({});
|
|
34
|
-
const FormItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
35
|
-
const id = React.useId();
|
|
36
|
-
return (<FormItemContext.Provider value={{ id }}>
|
|
37
|
-
<div ref={ref} className={cn("space-y-2", className)} {...props}/>
|
|
38
|
-
</FormItemContext.Provider>);
|
|
39
|
-
});
|
|
40
|
-
FormItem.displayName = "FormItem";
|
|
41
|
-
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
42
|
-
const { error, formItemId } = useFormField();
|
|
43
|
-
return (<Label ref={ref} className={cn(error && "text-destructive", className)} htmlFor={formItemId} {...props}/>);
|
|
44
|
-
});
|
|
45
|
-
FormLabel.displayName = "FormLabel";
|
|
46
|
-
const FormControl = React.forwardRef(({ ...props }, ref) => {
|
|
47
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
48
|
-
return (<Slot ref={ref} id={formItemId} aria-describedby={!error
|
|
49
|
-
? `${formDescriptionId}`
|
|
50
|
-
: `${formDescriptionId} ${formMessageId}`} aria-invalid={!!error} {...props}/>);
|
|
51
|
-
});
|
|
52
|
-
FormControl.displayName = "FormControl";
|
|
53
|
-
const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
|
|
54
|
-
const { formDescriptionId } = useFormField();
|
|
55
|
-
return (<p ref={ref} id={formDescriptionId} className={cn("text-sm text-muted-1", className)} {...props}/>);
|
|
56
|
-
});
|
|
57
|
-
FormDescription.displayName = "FormDescription";
|
|
58
|
-
const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
59
|
-
const { error, formMessageId } = useFormField();
|
|
60
|
-
const body = error ? String(error?.message) : children;
|
|
61
|
-
const classes = 'text-xs font-medium py-1 ' +
|
|
62
|
-
(error ? 'text-destructive' : 'text-muted-1') +
|
|
63
|
-
(body ? '' : ' invisible'); // Hold space in the layout
|
|
64
|
-
return (<p ref={ref} id={formMessageId} className={cn(classes, className)} {...props}>
|
|
65
|
-
{body ? body : 'dummy'}
|
|
66
|
-
</p>);
|
|
67
|
-
});
|
|
68
|
-
FormMessage.displayName = "FormMessage";
|
|
69
|
-
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {} from 'lucide-react';
|
|
3
|
-
const GitHub = (props) => (<svg viewBox="0 0 438.549 438.549" {...props}>
|
|
4
|
-
<path fill="currentColor" d="M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"></path>
|
|
5
|
-
</svg>);
|
|
6
|
-
export default GitHub;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {} from 'lucide-react';
|
|
3
|
-
const YouTubeLogo = (props) => (<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
4
|
-
<g style={{
|
|
5
|
-
stroke: 'none',
|
|
6
|
-
strokeWidth: 0,
|
|
7
|
-
strokeDasharray: 'none',
|
|
8
|
-
strokeLinecap: 'butt',
|
|
9
|
-
strokeLinejoin: 'miter',
|
|
10
|
-
strokeMiterlimit: 10,
|
|
11
|
-
fill: 'none',
|
|
12
|
-
fillRule: 'nonzero',
|
|
13
|
-
opacity: 1
|
|
14
|
-
}} transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
|
|
15
|
-
<path d="M 88.119 23.338 c -1.035 -3.872 -4.085 -6.922 -7.957 -7.957 C 73.144 13.5 45 13.5 45 13.5 s -28.144 0 -35.162 1.881 c -3.872 1.035 -6.922 4.085 -7.957 7.957 C 0 30.356 0 45 0 45 s 0 14.644 1.881 21.662 c 1.035 3.872 4.085 6.922 7.957 7.957 C 16.856 76.5 45 76.5 45 76.5 s 28.144 0 35.162 -1.881 c 3.872 -1.035 6.922 -4.085 7.957 -7.957 C 90 59.644 90 45 90 45 S 90 30.356 88.119 23.338 z" style={{
|
|
16
|
-
stroke: 'none',
|
|
17
|
-
strokeWidth: 1,
|
|
18
|
-
strokeDasharray: 'none',
|
|
19
|
-
strokeLinecap: 'butt',
|
|
20
|
-
strokeLinejoin: 'miter',
|
|
21
|
-
strokeMiterlimit: 10,
|
|
22
|
-
fill: 'red',
|
|
23
|
-
fillRule: 'nonzero',
|
|
24
|
-
opacity: 1
|
|
25
|
-
}} transform=" matrix(1 0 0 1 0 0) " strokeLinecap="round"/>
|
|
26
|
-
<polygon points="36,58.5 59.38,45 36,31.5 " style={{
|
|
27
|
-
stroke: 'none',
|
|
28
|
-
strokeWidth: 1,
|
|
29
|
-
strokeDasharray: 'none',
|
|
30
|
-
strokeLinecap: 'butt',
|
|
31
|
-
strokeLinejoin: 'miter',
|
|
32
|
-
strokeMiterlimit: 10,
|
|
33
|
-
fill: 'white',
|
|
34
|
-
fillRule: 'nonzero',
|
|
35
|
-
opacity: 1
|
|
36
|
-
}} transform="matrix(1 0 0 1 0 0)"/>
|
|
37
|
-
</g>
|
|
38
|
-
</svg>);
|
|
39
|
-
export default YouTubeLogo;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from './accordion';
|
|
2
|
-
export { Avatar, AvatarImage, AvatarFallback } from './avatar';
|
|
3
|
-
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, } from './breadcrumb';
|
|
4
|
-
export { default as Button, type ButtonProps, buttonVariants, } from './button';
|
|
5
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card';
|
|
6
|
-
export { type CarouselApi, type CarouselOptions, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from './carousel';
|
|
7
|
-
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, } from './command';
|
|
8
|
-
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, } from './context-menu';
|
|
9
|
-
export { type DrawerProps, Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHandle, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, } from './drawer';
|
|
10
|
-
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from './dialog';
|
|
11
|
-
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } from './form';
|
|
12
|
-
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, } from './input-otp';
|
|
13
|
-
export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, } from './navigation-menu';
|
|
14
|
-
export { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, } from './popover';
|
|
15
|
-
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, } from './select';
|
|
16
|
-
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } from './sheet';
|
|
17
|
-
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, } from './table';
|
|
18
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs';
|
|
19
|
-
export * from './tooltip';
|
|
20
|
-
export { default as ActionButton } from './action-button';
|
|
21
|
-
export { default as ApplyTypography, type TypographySize } from './apply-typography';
|
|
22
|
-
export { default as AspectRatio } from './aspect-ratio';
|
|
23
|
-
export { default as Badge } from './badge';
|
|
24
|
-
export { default as BreakpointIndicator } from './breakpoint-indicator';
|
|
25
|
-
export { default as Calendar } from './calendar';
|
|
26
|
-
export { default as Checkbox } from './checkbox';
|
|
27
|
-
export { default as Combobox, type ComboboxTriggerProps } from './combobox';
|
|
28
|
-
export { default as DialogVideoController } from './dialog-video-controller';
|
|
29
|
-
export { default as Input } from './input';
|
|
30
|
-
export { default as Label } from './label';
|
|
31
|
-
export type { default as ListAdaptor } from './list-adaptor';
|
|
32
|
-
export { default as ListBox } from './list-box';
|
|
33
|
-
export { default as LoadingSpinner } from './loading-spinner';
|
|
34
|
-
export { default as Progress } from './progress';
|
|
35
|
-
export { RadioGroup, RadioGroupItem } from './radio-group';
|
|
36
|
-
export { ScrollArea, ScrollBar } from './scroll-area';
|
|
37
|
-
export { default as Separator } from './separator';
|
|
38
|
-
export { default as Slider } from './slider';
|
|
39
|
-
export { default as Skeleton } from './skeleton';
|
|
40
|
-
export { default as StepIndicator } from './step-indicator';
|
|
41
|
-
export { default as Switch } from './switch';
|
|
42
|
-
export { default as TextArea } from './text-area';
|
|
43
|
-
export { Toaster, toast } from './sonner';
|
|
44
|
-
export { Toggle, toggleVariants } from './toggle';
|
|
45
|
-
export { ToggleGroup, ToggleGroupItem } from './toggle-group';
|
|
46
|
-
export { default as VideoPlayer } from './video-player';
|
|
47
|
-
export * as Icons from './icons';
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from './accordion';
|
|
2
|
-
export { Avatar, AvatarImage, AvatarFallback } from './avatar';
|
|
3
|
-
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, } from './breadcrumb';
|
|
4
|
-
export { default as Button, buttonVariants, } from './button';
|
|
5
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card';
|
|
6
|
-
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from './carousel';
|
|
7
|
-
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, } from './command';
|
|
8
|
-
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, } from './context-menu';
|
|
9
|
-
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHandle, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, } from './drawer';
|
|
10
|
-
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from './dialog';
|
|
11
|
-
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } from './form';
|
|
12
|
-
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, } from './input-otp';
|
|
13
|
-
export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, } from './navigation-menu';
|
|
14
|
-
export { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, } from './popover';
|
|
15
|
-
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, } from './select';
|
|
16
|
-
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } from './sheet';
|
|
17
|
-
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, } from './table';
|
|
18
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs';
|
|
19
|
-
export * from './tooltip';
|
|
20
|
-
export { default as ActionButton } from './action-button';
|
|
21
|
-
export { default as ApplyTypography } from './apply-typography';
|
|
22
|
-
export { default as AspectRatio } from './aspect-ratio';
|
|
23
|
-
export { default as Badge } from './badge';
|
|
24
|
-
export { default as BreakpointIndicator } from './breakpoint-indicator';
|
|
25
|
-
export { default as Calendar } from './calendar';
|
|
26
|
-
export { default as Checkbox } from './checkbox';
|
|
27
|
-
export { default as Combobox } from './combobox';
|
|
28
|
-
export { default as DialogVideoController } from './dialog-video-controller';
|
|
29
|
-
export { default as Input } from './input';
|
|
30
|
-
export { default as Label } from './label';
|
|
31
|
-
export { default as ListBox } from './list-box';
|
|
32
|
-
export { default as LoadingSpinner } from './loading-spinner';
|
|
33
|
-
export { default as Progress } from './progress';
|
|
34
|
-
export { RadioGroup, RadioGroupItem } from './radio-group';
|
|
35
|
-
export { ScrollArea, ScrollBar } from './scroll-area';
|
|
36
|
-
export { default as Separator } from './separator';
|
|
37
|
-
export { default as Slider } from './slider';
|
|
38
|
-
export { default as Skeleton } from './skeleton';
|
|
39
|
-
export { default as StepIndicator } from './step-indicator';
|
|
40
|
-
export { default as Switch } from './switch';
|
|
41
|
-
export { default as TextArea } from './text-area';
|
|
42
|
-
export { Toaster, toast } from './sonner';
|
|
43
|
-
export { Toggle, toggleVariants } from './toggle';
|
|
44
|
-
export { ToggleGroup, ToggleGroupItem } from './toggle-group';
|
|
45
|
-
export { default as VideoPlayer } from './video-player';
|
|
46
|
-
export * as Icons from './icons';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type SlotProps } from 'input-otp';
|
|
3
|
-
declare const InputOTP: React.ForwardRefExoticComponent<React.RefAttributes<never>>;
|
|
4
|
-
declare const InputOTPGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const InputOTPSlot: React.ForwardRefExoticComponent<SlotProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
declare const InputOTPSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { OTPInput } from 'input-otp';
|
|
4
|
-
import { Dot } from 'lucide-react';
|
|
5
|
-
import { cn } from '../util';
|
|
6
|
-
const InputOTP = React.forwardRef(({ className, ...props }, ref) => (<OTPInput ref={ref} containerClassName={cn('flex items-center gap-2', className)} {...props}/>));
|
|
7
|
-
InputOTP.displayName = 'InputOTP';
|
|
8
|
-
const InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn('flex items-center', className)} {...props}/>));
|
|
9
|
-
InputOTPGroup.displayName = 'InputOTPGroup';
|
|
10
|
-
const InputOTPSlot = React.forwardRef(({ char, hasFakeCaret, isActive, className, ...props }, ref) => {
|
|
11
|
-
return (<div ref={ref} className={cn('relative flex h-10 w-10 items-center justify-center border-y border-r border-muted-3 text-sm ', 'transition-all first:rounded-l-md first:border-l last:rounded-r-md', isActive && 'z-above-content ring-2 ring-muted', // TODO: couldn't find: 'ring-offset-background'
|
|
12
|
-
className)} {...props}>
|
|
13
|
-
{char}
|
|
14
|
-
{hasFakeCaret && (<div className='pointer-events-none absolute inset-0 flex items-center justify-center'>
|
|
15
|
-
<div className='animate-caret-blink h-4 w-px bg-foreground duration-1000'/>
|
|
16
|
-
</div>)}
|
|
17
|
-
</div>);
|
|
18
|
-
});
|
|
19
|
-
InputOTPSlot.displayName = 'InputOTPSlot';
|
|
20
|
-
const InputOTPSeparator = React.forwardRef(({ ...props }, ref) => (<div ref={ref} role='separator' {...props}>
|
|
21
|
-
<Dot />
|
|
22
|
-
</div>));
|
|
23
|
-
InputOTPSeparator.displayName = 'InputOTPSeparator';
|
|
24
|
-
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { cn } from "../util";
|
|
4
|
-
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
5
|
-
return (<input type={type} className={cn('flex h-10 w-full rounded-md border border-muted-3 bg-inherit px-3 py-2 text-sm ring-offset-background ' +
|
|
6
|
-
'file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-2 ' +
|
|
7
|
-
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 ' +
|
|
8
|
-
'first-letter:disabled:cursor-not-allowed disabled:opacity-50', className)} ref={ref} {...props}/>);
|
|
9
|
-
});
|
|
10
|
-
Input.displayName = "Input";
|
|
11
|
-
export default Input;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
-
import { type VariantProps } from "class-variance-authority";
|
|
4
|
-
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
-
export default Label;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
"use client";
|
|
3
|
-
import React from "react";
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
6
|
-
import { cva } from "class-variance-authority";
|
|
7
|
-
import { cn } from "../util";
|
|
8
|
-
const labelVariants = cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
9
|
-
const Label = React.forwardRef(({ className, ...props }, ref) => (<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props}/>));
|
|
10
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
11
|
-
export default Label;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface ListAdaptor<T> {
|
|
2
|
-
getValue: (el: T) => string;
|
|
3
|
-
equals: (el1: T, el2: T) => boolean;
|
|
4
|
-
valueEquals: (el: T, v: string) => boolean;
|
|
5
|
-
getLabel?: (el: T) => string;
|
|
6
|
-
getImageUrl?: (el: T) => string | null;
|
|
7
|
-
isDisabled?: (el: T) => boolean;
|
|
8
|
-
}
|
|
9
|
-
export { type ListAdaptor as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare function ListBox<T>({ values, labels, onValueChange, value, isEqual, clx, itemClx }: {
|
|
2
|
-
values: T[];
|
|
3
|
-
labels: string[];
|
|
4
|
-
onValueChange: (val: T) => void;
|
|
5
|
-
value: T | undefined;
|
|
6
|
-
isEqual: (v1: T, v2: T) => boolean;
|
|
7
|
-
clx?: string;
|
|
8
|
-
itemClx?: string;
|
|
9
|
-
}): JSX.Element;
|
|
10
|
-
export default ListBox;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cn } from '../util';
|
|
4
|
-
function Item({ value, label, className, onClick, first = false, last = false, selected = false }) {
|
|
5
|
-
return (<div className={cn('font-normal text-muted-1 px-3 py-1 cursor-pointer hover:text-foreground ', last ? '' : 'border-b', selected ? 'font-semibold text-accent hover:text-accent' : '', className)} onClick={() => { onClick(value); }}>
|
|
6
|
-
<span>{label}</span>
|
|
7
|
-
</div>);
|
|
8
|
-
}
|
|
9
|
-
function ListBox({ values, labels, onValueChange, value, isEqual, clx = '', itemClx = '' }) {
|
|
10
|
-
return (<div className={cn('border rounded-md select-none', clx)}>
|
|
11
|
-
{values.map((val, i) => (<Item value={val} label={labels[i]} onClick={onValueChange} className={itemClx} first={i === 0} last={i === values.length - 1} selected={value && isEqual(val, value)} key={labels[i]}/>))}
|
|
12
|
-
</div>);
|
|
13
|
-
}
|
|
14
|
-
export default ListBox;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { cn } from '../util';
|
|
2
|
-
// cf: https://github.com/shadcn-ui/ui/discussions/1694#discussioncomment-7851248
|
|
3
|
-
const LoadingSpinner = ({ size = 24, className = '', ...props }) => {
|
|
4
|
-
return (<svg width={size} height={size} {...props} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={cn("animate-spin", className)}>
|
|
5
|
-
<path d="M21 12a9 9 0 1 1-6.219-8.56"/>
|
|
6
|
-
</svg>);
|
|
7
|
-
};
|
|
8
|
-
export default LoadingSpinner;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
3
|
-
declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
4
|
-
declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
5
|
-
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
6
|
-
declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
|
-
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
-
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
-
declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
4
|
-
import { cva } from 'class-variance-authority';
|
|
5
|
-
import { ChevronDown } from 'lucide-react';
|
|
6
|
-
import { cn } from '../util';
|
|
7
|
-
const NavigationMenu = React.forwardRef(({ className, children, ...props }, ref) => (<NavigationMenuPrimitive.Root ref={ref} className={cn('relative z-10 flex max-w-max flex-1 items-center justify-center', className)} {...props}>
|
|
8
|
-
{children}
|
|
9
|
-
{/* <NavigationMenuViewport /> */}
|
|
10
|
-
</NavigationMenuPrimitive.Root>));
|
|
11
|
-
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
12
|
-
const NavigationMenuList = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.List ref={ref} className={cn('group flex flex-1 list-none items-center justify-center space-x-1', className)} {...props}/>));
|
|
13
|
-
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
14
|
-
const NavigationMenuItem = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.Item ref={ref} className={cn("relative", className)} {...props}/>));
|
|
15
|
-
NavigationMenuItem.displayName = 'NavigationMenuItem';
|
|
16
|
-
const navigationMenuTriggerStyle = cva('group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 ' +
|
|
17
|
-
'text-sm font-medium transition-colors hover:bg-level-1 text-foreground hover:text-accent ' +
|
|
18
|
-
' focus:text-accent focus:outline-none disabled:pointer-events-none disabled:opacity-50 ' +
|
|
19
|
-
'data-[active]:bg-level-1/50 data-[state=open]:bg-level-1/50');
|
|
20
|
-
const NavigationMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => (<NavigationMenuPrimitive.Trigger ref={ref} className={cn(navigationMenuTriggerStyle(), 'group', className)} {...props}>
|
|
21
|
-
{children}{' '}
|
|
22
|
-
<ChevronDown className='relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180' aria-hidden='true'/>
|
|
23
|
-
</NavigationMenuPrimitive.Trigger>));
|
|
24
|
-
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
25
|
-
const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.Content ref={ref} className={cn("right-0 absolute", "absolute top-full w-fit bg-popover mt-[5px]", "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 bg-background overflow-hidden rounded-md border", className)} {...props}/>));
|
|
26
|
-
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
27
|
-
const NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
28
|
-
const NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => (<div className={cn('absolute left-0 top-full flex justify-center')}>
|
|
29
|
-
<NavigationMenuPrimitive.Viewport className={cn('origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border ', 'bg-background text-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]', className)} ref={ref} {...props}/>
|
|
30
|
-
</div>));
|
|
31
|
-
NavigationMenuViewport.displayName =
|
|
32
|
-
NavigationMenuPrimitive.Viewport.displayName;
|
|
33
|
-
const NavigationMenuIndicator = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.Indicator ref={ref} className={cn('top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden', 'data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in', className)} {...props}>
|
|
34
|
-
<div className='relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md'/>
|
|
35
|
-
</NavigationMenuPrimitive.Indicator>));
|
|
36
|
-
NavigationMenuIndicator.displayName =
|
|
37
|
-
NavigationMenuPrimitive.Indicator.displayName;
|
|
38
|
-
export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ImageDef, Dimensions, MediaTransform } from '../../types';
|
|
3
|
-
declare const Image: React.FC<{
|
|
4
|
-
def: ImageDef;
|
|
5
|
-
constrainTo?: Dimensions;
|
|
6
|
-
transform?: MediaTransform;
|
|
7
|
-
fullWidth?: boolean;
|
|
8
|
-
className?: string;
|
|
9
|
-
preload?: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
export default Image;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import NextImage from 'next/image';
|
|
3
|
-
import { constrain, cn, spreadToTransform } from '../../util';
|
|
4
|
-
const Image = ({ def, constrainTo, transform = {}, fullWidth = false, className = '', preload = false }) => {
|
|
5
|
-
const { src, alt: _alt, dim, sizes, svgFillClass: _svgFillClass, } = def;
|
|
6
|
-
const toSpread = {};
|
|
7
|
-
if (fullWidth) {
|
|
8
|
-
toSpread.style = {
|
|
9
|
-
width: '100%',
|
|
10
|
-
height: 'auto',
|
|
11
|
-
...spreadToTransform(transform)
|
|
12
|
-
};
|
|
13
|
-
if (constrainTo) {
|
|
14
|
-
toSpread.style.maxWidth = constrainTo.w;
|
|
15
|
-
toSpread.style.maxHeight = constrainTo.h;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
const resolved = constrainTo ? constrain(dim, constrainTo) : dim;
|
|
20
|
-
toSpread.width = resolved.w;
|
|
21
|
-
toSpread.height = resolved.h;
|
|
22
|
-
toSpread.style = { ...spreadToTransform(transform) };
|
|
23
|
-
}
|
|
24
|
-
if (sizes) {
|
|
25
|
-
toSpread.sizes = sizes;
|
|
26
|
-
}
|
|
27
|
-
// Note: cannot be spread (a Next thing)
|
|
28
|
-
let alt;
|
|
29
|
-
if (_alt) {
|
|
30
|
-
alt = _alt;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
const tokens = src.split('/');
|
|
34
|
-
// Something remotely meaningful
|
|
35
|
-
alt = (tokens.length > 0) ? tokens[tokens.length - 1] : src;
|
|
36
|
-
}
|
|
37
|
-
const svgFillClass = _svgFillClass ?? '';
|
|
38
|
-
return (fullWidth) ? (<div className='relative flex flex-col items-center justify-center w-full'>
|
|
39
|
-
<NextImage src={src} alt={alt} {...toSpread} priority={preload} loading={preload ? 'eager' : 'lazy'} className={cn(svgFillClass, className)}/>
|
|
40
|
-
</div>) : (<NextImage src={src} alt={alt} {...toSpread} priority={preload} loading={preload ? 'eager' : 'lazy'} className={cn(svgFillClass, className)}/>);
|
|
41
|
-
};
|
|
42
|
-
export default Image;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as Image } from './image';
|
|
2
|
-
export { default as InlineIcon } from './inline-icon';
|
|
3
|
-
export { default as LinkElement } from './link-element';
|
|
4
|
-
export { default as MDXLink } from './mdx-link';
|
|
5
|
-
export { default as MediaStack } from './media-stack';
|
|
6
|
-
export { default as NavItems } from './nav-items';
|
|
7
|
-
export { default as YouTubeEmbed } from './youtube-embed';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as Image } from './image';
|
|
2
|
-
export { default as InlineIcon } from './inline-icon';
|
|
3
|
-
export { default as LinkElement } from './link-element';
|
|
4
|
-
export { default as MDXLink } from './mdx-link';
|
|
5
|
-
export { default as MediaStack } from './media-stack';
|
|
6
|
-
export { default as NavItems } from './nav-items';
|
|
7
|
-
export { default as YouTubeEmbed } from './youtube-embed';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const InlineIcon: React.FC<{
|
|
3
|
-
/**
|
|
4
|
-
* If a ReactNode is passed in, it should be set to 'w-full h-auto' so that it can be sized
|
|
5
|
-
* according to width of parent.
|
|
6
|
-
*/
|
|
7
|
-
icon: React.ReactNode;
|
|
8
|
-
/** default should be handled by calling code. */
|
|
9
|
-
size?: number;
|
|
10
|
-
agent?: string;
|
|
11
|
-
className?: string;
|
|
12
|
-
}>;
|
|
13
|
-
export default InlineIcon;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Image from 'next/image';
|
|
3
|
-
const InlineIcon = ({ icon, size, agent, className = '' }) => {
|
|
4
|
-
if (!icon)
|
|
5
|
-
return null;
|
|
6
|
-
const phone = agent === 'phone';
|
|
7
|
-
if (typeof icon === 'string') {
|
|
8
|
-
const _size = (phone && size) ? (size * .75) : size;
|
|
9
|
-
return (<Image src={icon} width={_size} height={_size} alt='icon' className={className}/>);
|
|
10
|
-
}
|
|
11
|
-
return (<div className={className}>
|
|
12
|
-
{icon}
|
|
13
|
-
</div>);
|
|
14
|
-
};
|
|
15
|
-
export default InlineIcon;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import type { LinkDef } from '../../types';
|
|
3
|
-
import { buttonVariants } from '../button';
|
|
4
|
-
import { type VariantProps } from '../../util';
|
|
5
|
-
/**
|
|
6
|
-
* If this is rendered directly (and not auto generated in a Block)
|
|
7
|
-
* and it has any children, title, icon, and iconAfter
|
|
8
|
-
* are ignore.
|
|
9
|
-
*/
|
|
10
|
-
declare const LinkElement: React.FC<PropsWithChildren & VariantProps<typeof buttonVariants> & {
|
|
11
|
-
def: LinkDef;
|
|
12
|
-
/**
|
|
13
|
-
* Use to trigger other events in addition to the
|
|
14
|
-
* link action itself. For example, to also close a drawer menu.
|
|
15
|
-
*/
|
|
16
|
-
onClick?: () => void;
|
|
17
|
-
/** overrides def (eg, for title area)*/
|
|
18
|
-
icon?: React.ReactNode;
|
|
19
|
-
/** overrides def */
|
|
20
|
-
iconAfter?: boolean;
|
|
21
|
-
className?: string;
|
|
22
|
-
}>;
|
|
23
|
-
export default LinkElement;
|