@kortix/ui 0.0.0-bootstrap.0 → 0.14.3
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.md +153 -2
- package/dist/_vendor/kortix-shared.js +341 -0
- package/dist/chat/agent-picker.d.ts +8 -0
- package/dist/chat/agent-picker.js +18 -0
- package/dist/chat/composer.d.ts +31 -0
- package/dist/chat/composer.js +114 -0
- package/dist/chat/index.d.ts +22 -0
- package/dist/chat/index.js +22 -0
- package/dist/chat/markdown.d.ts +10 -0
- package/dist/chat/markdown.js +36 -0
- package/dist/chat/message-list.d.ts +25 -0
- package/dist/chat/message-list.js +73 -0
- package/dist/chat/message-view.d.ts +17 -0
- package/dist/chat/message-view.js +86 -0
- package/dist/chat/model-picker.d.ts +10 -0
- package/dist/chat/model-picker.js +68 -0
- package/dist/chat/permission-prompt.d.ts +10 -0
- package/dist/chat/permission-prompt.js +40 -0
- package/dist/chat/question-prompt.d.ts +8 -0
- package/dist/chat/question-prompt.js +60 -0
- package/dist/chat/send-failure.d.ts +9 -0
- package/dist/chat/send-failure.js +21 -0
- package/dist/chat/session-thread.d.ts +28 -0
- package/dist/chat/session-thread.js +47 -0
- package/dist/chat/streaming-markdown.d.ts +21 -0
- package/dist/chat/streaming-markdown.js +59 -0
- package/dist/chat/tool-call.d.ts +4 -0
- package/dist/chat/tool-call.js +150 -0
- package/dist/chat/user-message-parts.d.ts +6 -0
- package/dist/chat/user-message-parts.js +11 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.js +18 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert-dialog.js +48 -0
- package/dist/components/ui/alert.d.ts +13 -0
- package/dist/components/ui/alert.js +67 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/avatar.js +23 -0
- package/dist/components/ui/back-pill.d.ts +13 -0
- package/dist/components/ui/back-pill.js +18 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.js +42 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.js +28 -0
- package/dist/components/ui/bubble.d.ts +20 -0
- package/dist/components/ui/bubble.js +38 -0
- package/dist/components/ui/button-group.d.ts +9 -0
- package/dist/components/ui/button-group.js +32 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/button.js +67 -0
- package/dist/components/ui/calendar.d.ts +4 -0
- package/dist/components/ui/calendar.js +39 -0
- package/dist/components/ui/card.d.ts +96 -0
- package/dist/components/ui/card.js +291 -0
- package/dist/components/ui/chain-of-thought.d.ts +75 -0
- package/dist/components/ui/chain-of-thought.js +66 -0
- package/dist/components/ui/chart.d.ts +65 -0
- package/dist/components/ui/chart.js +118 -0
- package/dist/components/ui/checkbox-group.d.ts +19 -0
- package/dist/components/ui/checkbox-group.js +41 -0
- package/dist/components/ui/checkbox.d.ts +14 -0
- package/dist/components/ui/checkbox.js +27 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +14 -0
- package/dist/components/ui/command.d.ts +58 -0
- package/dist/components/ui/command.js +135 -0
- package/dist/components/ui/confirm-dialog.d.ts +19 -0
- package/dist/components/ui/confirm-dialog.js +30 -0
- package/dist/components/ui/context-menu.d.ts +45 -0
- package/dist/components/ui/context-menu.js +93 -0
- package/dist/components/ui/count-badge.d.ts +26 -0
- package/dist/components/ui/count-badge.js +26 -0
- package/dist/components/ui/data-grid.d.ts +24 -0
- package/dist/components/ui/data-grid.js +107 -0
- package/dist/components/ui/date-range-picker.d.ts +119 -0
- package/dist/components/ui/date-range-picker.js +190 -0
- package/dist/components/ui/definition-list.d.ts +15 -0
- package/dist/components/ui/definition-list.js +26 -0
- package/dist/components/ui/dialog.d.ts +29 -0
- package/dist/components/ui/dialog.js +52 -0
- package/dist/components/ui/disclosure.d.ts +121 -0
- package/dist/components/ui/disclosure.js +138 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-10.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-10.js +29 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-12.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-12.js +19 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-13.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-13.js +19 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-15.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-15.js +22 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-16.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-16.js +5 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-18.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-18.js +5 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-19.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-19.js +5 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-2.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-2.js +3 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-20.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-20.js +5 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-21.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-21.js +5 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-3.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-3.js +3 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-4.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-4.js +3 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-5.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-5.js +3 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-6.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-6.js +19 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-7.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-7.js +19 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-8.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-8.js +19 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-9.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-3x3-9.js +23 -0
- package/dist/components/ui/dot-matrix/dotm-circular-1.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-1.js +28 -0
- package/dist/components/ui/dot-matrix/dotm-circular-10.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-10.js +40 -0
- package/dist/components/ui/dot-matrix/dotm-circular-11.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-11.js +37 -0
- package/dist/components/ui/dot-matrix/dotm-circular-12.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-12.js +42 -0
- package/dist/components/ui/dot-matrix/dotm-circular-14.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-14.js +37 -0
- package/dist/components/ui/dot-matrix/dotm-circular-15.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-15.js +49 -0
- package/dist/components/ui/dot-matrix/dotm-circular-17.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-17.js +31 -0
- package/dist/components/ui/dot-matrix/dotm-circular-2.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-2.js +37 -0
- package/dist/components/ui/dot-matrix/dotm-circular-3.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-3.js +54 -0
- package/dist/components/ui/dot-matrix/dotm-circular-4.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-4.js +35 -0
- package/dist/components/ui/dot-matrix/dotm-circular-5.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-5.js +30 -0
- package/dist/components/ui/dot-matrix/dotm-circular-6.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-6.js +37 -0
- package/dist/components/ui/dot-matrix/dotm-circular-7.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-7.js +25 -0
- package/dist/components/ui/dot-matrix/dotm-circular-8.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-8.js +26 -0
- package/dist/components/ui/dot-matrix/dotm-circular-9.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-circular-9.js +41 -0
- package/dist/components/ui/dot-matrix/dotm-square-1.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-1.js +27 -0
- package/dist/components/ui/dot-matrix/dotm-square-10.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-10.js +27 -0
- package/dist/components/ui/dot-matrix/dotm-square-11.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-11.js +25 -0
- package/dist/components/ui/dot-matrix/dotm-square-12.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-12.js +28 -0
- package/dist/components/ui/dot-matrix/dotm-square-13.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-13.js +45 -0
- package/dist/components/ui/dot-matrix/dotm-square-14.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-14.js +38 -0
- package/dist/components/ui/dot-matrix/dotm-square-15.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-15.js +31 -0
- package/dist/components/ui/dot-matrix/dotm-square-16.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-16.js +33 -0
- package/dist/components/ui/dot-matrix/dotm-square-17.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-17.js +27 -0
- package/dist/components/ui/dot-matrix/dotm-square-18.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-18.js +29 -0
- package/dist/components/ui/dot-matrix/dotm-square-19.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-19.js +74 -0
- package/dist/components/ui/dot-matrix/dotm-square-2.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-2.js +72 -0
- package/dist/components/ui/dot-matrix/dotm-square-20.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-20.js +79 -0
- package/dist/components/ui/dot-matrix/dotm-square-3.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-3.js +23 -0
- package/dist/components/ui/dot-matrix/dotm-square-4.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-4.js +41 -0
- package/dist/components/ui/dot-matrix/dotm-square-5.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-5.js +23 -0
- package/dist/components/ui/dot-matrix/dotm-square-6.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-6.js +20 -0
- package/dist/components/ui/dot-matrix/dotm-square-7.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-7.js +43 -0
- package/dist/components/ui/dot-matrix/dotm-square-8.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-8.js +57 -0
- package/dist/components/ui/dot-matrix/dotm-square-9.d.ts +4 -0
- package/dist/components/ui/dot-matrix/dotm-square-9.js +89 -0
- package/dist/components/ui/dot-matrix/session-dot-matrix.d.ts +46 -0
- package/dist/components/ui/dot-matrix/session-dot-matrix.js +153 -0
- package/dist/components/ui/drawer.d.ts +15 -0
- package/dist/components/ui/drawer.js +35 -0
- package/dist/components/ui/dropdown-menu.d.ts +49 -0
- package/dist/components/ui/dropdown-menu.js +113 -0
- package/dist/components/ui/emoji-picker.d.ts +15 -0
- package/dist/components/ui/emoji-picker.js +137 -0
- package/dist/components/ui/emoji-tint.d.ts +41 -0
- package/dist/components/ui/emoji-tint.js +131 -0
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/empty.js +33 -0
- package/dist/components/ui/entity-avatar.d.ts +84 -0
- package/dist/components/ui/entity-avatar.js +106 -0
- package/dist/components/ui/faded-scroll-area.d.ts +8 -0
- package/dist/components/ui/faded-scroll-area.js +80 -0
- package/dist/components/ui/favicon-avatar.d.ts +32 -0
- package/dist/components/ui/favicon-avatar.js +18 -0
- package/dist/components/ui/field.d.ts +15 -0
- package/dist/components/ui/field.js +48 -0
- package/dist/components/ui/file-tree.d.ts +32 -0
- package/dist/components/ui/file-tree.js +30 -0
- package/dist/components/ui/glyph-face.d.ts +18 -0
- package/dist/components/ui/glyph-face.js +37 -0
- package/dist/components/ui/glyph-paths-source.d.ts +2 -0
- package/dist/components/ui/glyph-paths-source.js +40 -0
- package/dist/components/ui/glyph-paths.generated.d.ts +2 -0
- package/dist/components/ui/glyph-paths.generated.js +207 -0
- package/dist/components/ui/glyph-picker.d.ts +22 -0
- package/dist/components/ui/glyph-picker.js +118 -0
- package/dist/components/ui/glyph-registry.d.ts +36 -0
- package/dist/components/ui/glyph-registry.js +479 -0
- package/dist/components/ui/glyph-tint.d.ts +6 -0
- package/dist/components/ui/glyph-tint.js +93 -0
- package/dist/components/ui/hint.d.ts +14 -0
- package/dist/components/ui/hint.js +12 -0
- package/dist/components/ui/histogram-bars.d.ts +38 -0
- package/dist/components/ui/histogram-bars.js +93 -0
- package/dist/components/ui/hover-card.d.ts +28 -0
- package/dist/components/ui/hover-card.js +35 -0
- package/dist/components/ui/icon-provider.d.ts +23 -0
- package/dist/components/ui/icon-provider.js +30 -0
- package/dist/components/ui/info-banner.d.ts +14 -0
- package/dist/components/ui/info-banner.js +72 -0
- package/dist/components/ui/inline-meta.d.ts +6 -0
- package/dist/components/ui/inline-meta.js +8 -0
- package/dist/components/ui/input-group.d.ts +19 -0
- package/dist/components/ui/input-group.js +73 -0
- package/dist/components/ui/input.d.ts +26 -0
- package/dist/components/ui/input.js +23 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.js +67 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +20 -0
- package/dist/components/ui/kortix-asterisk.d.ts +6 -0
- package/dist/components/ui/kortix-asterisk.js +17 -0
- package/dist/components/ui/kortix-icons.d.ts +2 -0
- package/dist/components/ui/kortix-icons.js +17 -0
- package/dist/components/ui/kortix-loader.d.ts +76 -0
- package/dist/components/ui/kortix-loader.js +74 -0
- package/dist/components/ui/kortix-logo.d.ts +30 -0
- package/dist/components/ui/kortix-logo.js +47 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.js +9 -0
- package/dist/components/ui/list.d.ts +15 -0
- package/dist/components/ui/list.js +25 -0
- package/dist/components/ui/loading.d.ts +19 -0
- package/dist/components/ui/loading.js +31 -0
- package/dist/components/ui/local-time.d.ts +34 -0
- package/dist/components/ui/local-time.js +60 -0
- package/dist/components/ui/map.d.ts +101 -0
- package/dist/components/ui/map.js +257 -0
- package/dist/components/ui/marker.d.ts +14 -0
- package/dist/components/ui/marker.js +28 -0
- package/dist/components/ui/menu-recipe.d.ts +102 -0
- package/dist/components/ui/menu-recipe.js +129 -0
- package/dist/components/ui/mermaid-render.d.ts +51 -0
- package/dist/components/ui/mermaid-render.js +65 -0
- package/dist/components/ui/mermaid-renderer.d.ts +13 -0
- package/dist/components/ui/mermaid-renderer.js +340 -0
- package/dist/components/ui/message.d.ts +15 -0
- package/dist/components/ui/message.js +26 -0
- package/dist/components/ui/modal.d.ts +104 -0
- package/dist/components/ui/modal.js +180 -0
- package/dist/components/ui/navigation-menu.d.ts +16 -0
- package/dist/components/ui/navigation-menu.js +35 -0
- package/dist/components/ui/page-search-bar.d.ts +11 -0
- package/dist/components/ui/page-search-bar.js +13 -0
- package/dist/components/ui/phone-input.d.ts +7 -0
- package/dist/components/ui/phone-input.js +59 -0
- package/dist/components/ui/pixel-kortix-mark.d.ts +13 -0
- package/dist/components/ui/pixel-kortix-mark.js +40 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.js +38 -0
- package/dist/components/ui/portal.d.ts +5 -0
- package/dist/components/ui/portal.js +15 -0
- package/dist/components/ui/preview-image.d.ts +14 -0
- package/dist/components/ui/preview-image.js +58 -0
- package/dist/components/ui/progress-ring.d.ts +6 -0
- package/dist/components/ui/progress-ring.js +9 -0
- package/dist/components/ui/progress.d.ts +6 -0
- package/dist/components/ui/progress.js +8 -0
- package/dist/components/ui/radio-group.d.ts +12 -0
- package/dist/components/ui/radio-group.js +20 -0
- package/dist/components/ui/resizable.d.ts +24 -0
- package/dist/components/ui/resizable.js +16 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.js +11 -0
- package/dist/components/ui/section-card.d.ts +37 -0
- package/dist/components/ui/section-card.js +14 -0
- package/dist/components/ui/section.d.ts +10 -0
- package/dist/components/ui/section.js +22 -0
- package/dist/components/ui/select.d.ts +25 -0
- package/dist/components/ui/select.js +59 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +8 -0
- package/dist/components/ui/shader-safe.d.ts +48 -0
- package/dist/components/ui/shader-safe.js +74 -0
- package/dist/components/ui/sheet.d.ts +32 -0
- package/dist/components/ui/sheet.js +55 -0
- package/dist/components/ui/sidebar-context.d.ts +72 -0
- package/dist/components/ui/sidebar-context.js +36 -0
- package/dist/components/ui/sidebar-menu-primitives.d.ts +38 -0
- package/dist/components/ui/sidebar-menu-primitives.js +97 -0
- package/dist/components/ui/sidebar-panel.d.ts +36 -0
- package/dist/components/ui/sidebar-panel.js +265 -0
- package/dist/components/ui/sidebar-peek.d.ts +27 -0
- package/dist/components/ui/sidebar-peek.js +70 -0
- package/dist/components/ui/sidebar-width.d.ts +48 -0
- package/dist/components/ui/sidebar-width.js +62 -0
- package/dist/components/ui/sidebar.d.ts +18 -0
- package/dist/components/ui/sidebar.js +194 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.js +6 -0
- package/dist/components/ui/slider-native.d.ts +7 -0
- package/dist/components/ui/slider-native.js +16 -0
- package/dist/components/ui/slider.d.ts +14 -0
- package/dist/components/ui/slider.js +48 -0
- package/dist/components/ui/sliding-tab-indicator.d.ts +61 -0
- package/dist/components/ui/sliding-tab-indicator.js +128 -0
- package/dist/components/ui/split-sheet.d.ts +61 -0
- package/dist/components/ui/split-sheet.js +239 -0
- package/dist/components/ui/spotlight-card.d.ts +8 -0
- package/dist/components/ui/spotlight-card.js +43 -0
- package/dist/components/ui/status-ring.d.ts +38 -0
- package/dist/components/ui/status-ring.js +38 -0
- package/dist/components/ui/status.d.ts +58 -0
- package/dist/components/ui/status.js +76 -0
- package/dist/components/ui/stepper.d.ts +28 -0
- package/dist/components/ui/stepper.js +73 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/switch.js +131 -0
- package/dist/components/ui/system-message.d.ts +23 -0
- package/dist/components/ui/system-message.js +51 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +28 -0
- package/dist/components/ui/tabs.d.ts +73 -0
- package/dist/components/ui/tabs.js +207 -0
- package/dist/components/ui/tag.d.ts +7 -0
- package/dist/components/ui/tag.js +22 -0
- package/dist/components/ui/text-shimmer.d.ts +13 -0
- package/dist/components/ui/text-shimmer.js +91 -0
- package/dist/components/ui/textarea.d.ts +33 -0
- package/dist/components/ui/textarea.js +87 -0
- package/dist/components/ui/toast.d.ts +105 -0
- package/dist/components/ui/toast.js +233 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/toggle.js +26 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +16 -0
- package/dist/components/ui/trigger-variants.d.ts +14 -0
- package/dist/components/ui/trigger-variants.js +67 -0
- package/dist/components/ui/type-to-confirm-dialog.d.ts +88 -0
- package/dist/components/ui/type-to-confirm-dialog.js +101 -0
- package/dist/components/ui/typed-title-logic.d.ts +22 -0
- package/dist/components/ui/typed-title-logic.js +33 -0
- package/dist/components/ui/typed-title.d.ts +38 -0
- package/dist/components/ui/typed-title.js +66 -0
- package/dist/components/ui/typing-animation.d.ts +36 -0
- package/dist/components/ui/typing-animation.js +141 -0
- package/dist/components/ui/user-avatar.d.ts +47 -0
- package/dist/components/ui/user-avatar.js +46 -0
- package/dist/hooks/use-debounce.d.ts +4 -0
- package/dist/hooks/use-debounce.js +17 -0
- package/dist/hooks/use-is-dark.d.ts +2 -0
- package/dist/hooks/use-is-dark.js +27 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/hooks/use-proximity-hover.d.ts +52 -0
- package/dist/hooks/use-proximity-hover.js +232 -0
- package/dist/icons/close.d.ts +2 -0
- package/dist/icons/close.js +7 -0
- package/dist/icons/copy.d.ts +3 -0
- package/dist/icons/copy.js +6 -0
- package/dist/icons/sidebar-toggle.d.ts +13 -0
- package/dist/icons/sidebar-toggle.js +13 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +33 -0
- package/dist/lib/dotmatrix-core.d.ts +113 -0
- package/dist/lib/dotmatrix-core.js +920 -0
- package/dist/lib/dotmatrix-hooks.d.ts +28 -0
- package/dist/lib/dotmatrix-hooks.js +151 -0
- package/dist/lib/favicon.d.ts +4 -0
- package/dist/lib/favicon.js +21 -0
- package/dist/lib/font-weight.d.ts +6 -0
- package/dist/lib/font-weight.js +6 -0
- package/dist/lib/icon-config.d.ts +33 -0
- package/dist/lib/icon-config.js +22 -0
- package/dist/lib/icon-context.d.ts +34 -0
- package/dist/lib/icon-context.js +81 -0
- package/dist/lib/portal-root.d.ts +8 -0
- package/dist/lib/portal-root.js +26 -0
- package/dist/lib/settle.d.ts +16 -0
- package/dist/lib/settle.js +29 -0
- package/dist/lib/springs.d.ts +31 -0
- package/dist/lib/springs.js +29 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/lib/z-stack.d.ts +55 -0
- package/dist/lib/z-stack.js +130 -0
- package/dist/providers/ui-provider.d.ts +141 -0
- package/dist/providers/ui-provider.js +93 -0
- package/dist/styles/dotmatrix-loader.css +1239 -0
- package/dist/styles/fonts.css +46 -0
- package/dist/styles/tailwind.css +10 -0
- package/dist/styles/theme.css +1019 -0
- package/dist/styles/tokens.css +146 -0
- package/dist/styles.css +2 -0
- package/package.json +874 -4
- package/skills/kortix-ui/SKILL.md +150 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* import {
|
|
7
|
+
* Modal,
|
|
8
|
+
* ModalBody,
|
|
9
|
+
* ModalContent,
|
|
10
|
+
* ModalDescription,
|
|
11
|
+
* ModalFooter,
|
|
12
|
+
* ModalHeader,
|
|
13
|
+
* ModalTitle,
|
|
14
|
+
* ModalTrigger,
|
|
15
|
+
* } from './modal.js';
|
|
16
|
+
* import { Button } from './button.js';
|
|
17
|
+
*
|
|
18
|
+
* <Modal>
|
|
19
|
+
* <ModalTrigger asChild>
|
|
20
|
+
* <Button>Open</Button>
|
|
21
|
+
* </ModalTrigger>
|
|
22
|
+
* <ModalContent className="lg:max-w-md">
|
|
23
|
+
* <ModalHeader>
|
|
24
|
+
* <ModalTitle>Title</ModalTitle>
|
|
25
|
+
* <ModalDescription>Description</ModalDescription>
|
|
26
|
+
* </ModalHeader>
|
|
27
|
+
* <ModalBody>{children}</ModalBody>
|
|
28
|
+
* <ModalFooter>
|
|
29
|
+
* <Button variant="outline-ghost">Cancel</Button>
|
|
30
|
+
* <Button>Confirm</Button>
|
|
31
|
+
* </ModalFooter>
|
|
32
|
+
* </ModalContent>
|
|
33
|
+
* </Modal>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* Controlled:
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <Modal open={open} onOpenChange={setOpen}>
|
|
39
|
+
* <ModalContent>...</ModalContent>
|
|
40
|
+
* </Modal>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
44
|
+
import { cva } from 'class-variance-authority';
|
|
45
|
+
import * as React from 'react';
|
|
46
|
+
import { Close } from '../../icons/close.js';
|
|
47
|
+
import { cn } from '../../lib/utils.js';
|
|
48
|
+
import { DialogDepthProvider, dialogContentZ, dialogOverlayZ, hasOpenFloatingLayer, isFloatingLayerTarget, useDialogDepth, useDialogRootLayer, } from '../../lib/z-stack.js';
|
|
49
|
+
import { Button } from './button.js';
|
|
50
|
+
import { triggerVariants } from './trigger-variants.js';
|
|
51
|
+
// Stacks by open order, not only by JSX nesting: a Modal opened while another
|
|
52
|
+
// is open sits above it even when the two share no React ancestor.
|
|
53
|
+
const Modal = ({ open, defaultOpen, onOpenChange, ...props }) => {
|
|
54
|
+
const layer = useDialogRootLayer({ open, defaultOpen, onOpenChange });
|
|
55
|
+
return (_jsx(DialogDepthProvider, { depth: layer.depth, children: _jsx(DialogPrimitive.Root, { ...props, open: layer.open, onOpenChange: layer.onOpenChange }) }));
|
|
56
|
+
};
|
|
57
|
+
const ModalTrigger = ({ className, variant, size, asChild, ...props }) => (_jsx(DialogPrimitive.Trigger, { asChild: asChild,
|
|
58
|
+
// With `asChild` the child owns its styling — merging ours would double it.
|
|
59
|
+
className: asChild ? className : cn(triggerVariants({ variant, size }), className), ...props }));
|
|
60
|
+
const ModalClose = DialogPrimitive.Close;
|
|
61
|
+
const ModalPortal = DialogPrimitive.Portal;
|
|
62
|
+
const overlayAnimationClasses = {
|
|
63
|
+
default: 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-200',
|
|
64
|
+
none: '',
|
|
65
|
+
};
|
|
66
|
+
const ModalOverlay = React.forwardRef(({ className, style, animation = 'default', ...props }, ref) => {
|
|
67
|
+
const depth = useDialogDepth();
|
|
68
|
+
return (_jsx(DialogPrimitive.Overlay, { className: cn('fixed inset-0 bg-black/65 backdrop-blur-xs', overlayAnimationClasses[animation], className), style: { zIndex: dialogOverlayZ(depth), ...style }, ...props, ref: ref }));
|
|
69
|
+
});
|
|
70
|
+
ModalOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
71
|
+
const ModalVariants = cva(cn('fixed gap-0 border p-0 shadow-lg overflow-y-auto', 'lg:top-[50%] lg:left-[50%] lg:grid lg:w-full lg:max-w-lg lg:-translate-x-1/2 lg:-translate-y-1/2 lg:rounded-xl', 'lg:flex lg:h-full lg:flex-col space-y-4'), {
|
|
72
|
+
variants: {
|
|
73
|
+
variant: {
|
|
74
|
+
default: 'bg-sidebar border-muted/60',
|
|
75
|
+
base: 'bg-background border-muted/60',
|
|
76
|
+
transparent: 'bg-transparent border-none p-0',
|
|
77
|
+
},
|
|
78
|
+
side: {
|
|
79
|
+
top: 'inset-x-0 top-0 border-b rounded-b-xl max-h-[90%] lg:h-fit',
|
|
80
|
+
bottom: 'inset-x-0 bottom-0 lg:bottom-auto border-t lg:h-auto max-h-[90%] rounded-t-xl',
|
|
81
|
+
left: 'inset-y-0 left-0 h-full lg:h-fit w-3/4 border-r rounded-r-xl sm:max-w-sm',
|
|
82
|
+
right: 'inset-y-0 right-0 h-full lg:h-fit w-3/4 border-l rounded-l-xl sm:max-w-sm',
|
|
83
|
+
fullscreen: 'inset-0 bg-black/60 dark:bg-black/85',
|
|
84
|
+
},
|
|
85
|
+
animation: {
|
|
86
|
+
default: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-200', 'lg:data-[state=closed]:zoom-out-95 lg:data-[state=open]:zoom-in-95'),
|
|
87
|
+
none: '',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
compoundVariants: [
|
|
91
|
+
{
|
|
92
|
+
animation: 'default',
|
|
93
|
+
side: 'top',
|
|
94
|
+
class: 'max-lg:data-[state=closed]:slide-out-to-top max-lg:data-[state=open]:slide-in-from-top',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
animation: 'default',
|
|
98
|
+
side: 'bottom',
|
|
99
|
+
class: 'max-lg:data-[state=closed]:slide-out-to-bottom max-lg:data-[state=open]:slide-in-from-bottom',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
animation: 'default',
|
|
103
|
+
side: 'left',
|
|
104
|
+
class: 'max-lg:data-[state=closed]:slide-out-to-left max-lg:data-[state=open]:slide-in-from-left',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
animation: 'default',
|
|
108
|
+
side: 'right',
|
|
109
|
+
class: 'max-lg:data-[state=closed]:slide-out-to-right max-lg:data-[state=open]:slide-in-from-right',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
defaultVariants: {
|
|
113
|
+
side: 'bottom',
|
|
114
|
+
variant: 'default',
|
|
115
|
+
animation: 'default',
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* Should an "outside" interaction actually dismiss the modal?
|
|
120
|
+
*
|
|
121
|
+
* Two cases both look like backdrop clicks to Radix and must NOT dismiss:
|
|
122
|
+
*
|
|
123
|
+
* 1. The click lands on a portaled Select / DropdownMenu / tooltip panel.
|
|
124
|
+
* Those portal to `document.body`, outside the modal's DOM subtree, so
|
|
125
|
+
* containment says "outside". `isFloatingLayerTarget` catches that.
|
|
126
|
+
*
|
|
127
|
+
* 2. A *modal* DropdownMenu is open and the click lands anywhere else —
|
|
128
|
+
* including visually on the modal body, or on the dark overlay. While the
|
|
129
|
+
* menu is open Radix sets `pointer-events: none` on everything under it, so
|
|
130
|
+
* the event target is `body` / the overlay, not the menu. Checking the
|
|
131
|
+
* target alone fails; Escape already uses `hasOpenFloatingLayer()` for the
|
|
132
|
+
* same reason. The gesture owns the floating layer: dismiss that first, and
|
|
133
|
+
* require a second click to close the modal.
|
|
134
|
+
*/
|
|
135
|
+
export function modalDismissesOnOutsideInteraction(target, closeOnOutsideClick) {
|
|
136
|
+
if (!closeOnOutsideClick)
|
|
137
|
+
return false;
|
|
138
|
+
if (hasOpenFloatingLayer())
|
|
139
|
+
return false;
|
|
140
|
+
return !isFloatingLayerTarget(target);
|
|
141
|
+
}
|
|
142
|
+
const ModalContentInner = React.forwardRef(({ side = 'bottom', animation = 'default', className, modalClassName, closeClassName, closeLabel = 'Close', children, variant = 'default', showCloseButton = true, closeButtonChildren, closeOnOutsideClick = true, overlayClassName, style, ...props }, ref) => {
|
|
143
|
+
const depth = useDialogDepth();
|
|
144
|
+
const handleInteractOutside = (event) => {
|
|
145
|
+
if (!modalDismissesOnOutsideInteraction(event.detail.originalEvent.target, closeOnOutsideClick)) {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
// Same asymmetry for the keyboard: Escape aimed at an open select or menu must
|
|
150
|
+
// dismiss that panel, not the modal underneath it.
|
|
151
|
+
//
|
|
152
|
+
// Deliberately NOT guarded on `hasOpenNestedDialog()`. Radix runs this handler
|
|
153
|
+
// on the top-most layer only, so a nested modal would see its own parent in
|
|
154
|
+
// that count, prevent its own dismissal, and leave Escape dead. Callers that
|
|
155
|
+
// need the nested-dialog guard pass their own `onEscapeKeyDown` — it lands in
|
|
156
|
+
// `...props` below and replaces this one (see the legacy Customize panel).
|
|
157
|
+
const handleEscapeKeyDown = (event) => {
|
|
158
|
+
if (hasOpenFloatingLayer()) {
|
|
159
|
+
event.preventDefault();
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
return (_jsxs(DialogPrimitive.Content, { ref: ref, className: cn(ModalVariants({ side, animation, className: modalClassName, variant }), className, 'rounded-xl rounded-b-none lg:rounded-b-xl'), style: { zIndex: dialogContentZ(depth), ...style }, onInteractOutside: handleInteractOutside, onEscapeKeyDown: handleEscapeKeyDown, ...props, children: [children, _jsxs("div", { className: "absolute top-3 right-3 flex items-center justify-end gap-2", children: [closeButtonChildren, showCloseButton && (_jsx(ModalClose, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: cn('size-8 p-0 text-xs font-semibold focus:outline-none', closeClassName), children: [_jsx(Close, { className: "text-primary size-4 stroke-1" }), _jsx("span", { className: "sr-only", children: closeLabel })] }) }))] })] }));
|
|
163
|
+
});
|
|
164
|
+
ModalContentInner.displayName = 'ModalContentInner';
|
|
165
|
+
const ModalContent = React.forwardRef(({ animation = 'default', overlayClassName, ...props }, ref) => {
|
|
166
|
+
const resolvedAnimation = animation ?? 'default';
|
|
167
|
+
return (_jsxs(ModalPortal, { children: [_jsx(ModalOverlay, { animation: resolvedAnimation, className: overlayClassName }), _jsx(ModalContentInner, { animation: resolvedAnimation, ...props, ref: ref })] }));
|
|
168
|
+
});
|
|
169
|
+
ModalContent.displayName = DialogPrimitive.Content.displayName;
|
|
170
|
+
const ModalHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-0 text-left', 'px-5 pt-5', className), ...props }));
|
|
171
|
+
ModalHeader.displayName = 'ModalHeader';
|
|
172
|
+
const ModalFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col-reverse items-center justify-end gap-y-2 rounded-b-none px-5 sm:flex-row sm:justify-end sm:space-x-2 sm:gap-y-0 md:rounded-b-xl md:px-5 lg:rounded-b-xl', className), ...props }));
|
|
173
|
+
ModalFooter.displayName = 'ModalFooter';
|
|
174
|
+
const ModalTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn('text-foreground text-base font-semibold', className), ...props })));
|
|
175
|
+
ModalTitle.displayName = DialogPrimitive.Title.displayName;
|
|
176
|
+
const ModalDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn('text-muted-foreground text-sm', className), ...props })));
|
|
177
|
+
ModalDescription.displayName = DialogPrimitive.Description.displayName;
|
|
178
|
+
const ModalBody = ({ className, ...props }) => (_jsx("div", { className: cn('flex-1 space-y-4 p-5 pt-0', className), ...props }));
|
|
179
|
+
ModalBody.displayName = 'ModalBody';
|
|
180
|
+
export { Modal, ModalBody, ModalClose, ModalContent, ModalContentInner, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
2
|
+
import { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare function NavigationMenu({ className, children, viewport, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
5
|
+
viewport?: boolean;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>): React.JSX.Element;
|
|
8
|
+
declare function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>): React.JSX.Element;
|
|
9
|
+
declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
10
|
+
declare function NavigationMenuTrigger({ className, children, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>): React.JSX.Element;
|
|
11
|
+
declare function NavigationMenuContent({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>): React.JSX.Element;
|
|
12
|
+
declare function NavigationMenuViewport({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>): React.JSX.Element;
|
|
13
|
+
declare function NavigationMenuLink({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>): React.JSX.Element;
|
|
14
|
+
declare function NavigationMenuSeparator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
|
|
15
|
+
declare function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>): React.JSX.Element;
|
|
16
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuSeparator, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuViewport, };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CaretDownIcon as ChevronDownIcon } from '@phosphor-icons/react';
|
|
3
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui';
|
|
6
|
+
import { cn } from '../../lib/utils.js';
|
|
7
|
+
function NavigationMenu({ className, children, viewport = true, ...props }) {
|
|
8
|
+
return (_jsxs(NavigationMenuPrimitive.Root, { "data-slot": "navigation-menu", "data-viewport": viewport, className: cn('group/navigation-menu relative flex max-w-max flex-1 items-center justify-center', className), ...props, children: [children, viewport && _jsx(NavigationMenuViewport, {})] }));
|
|
9
|
+
}
|
|
10
|
+
function NavigationMenuList({ className, ...props }) {
|
|
11
|
+
return (_jsx(NavigationMenuPrimitive.List, { "data-slot": "navigation-menu-list", className: cn('group flex flex-1 list-none items-center justify-center gap-1', className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
14
|
+
return (_jsx(NavigationMenuPrimitive.Item, { "data-slot": "navigation-menu-item", className: cn('relative', className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
const navigationMenuTriggerStyle = cva('group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent');
|
|
17
|
+
function NavigationMenuTrigger({ className, children, ...props }) {
|
|
18
|
+
return (_jsxs(NavigationMenuPrimitive.Trigger, { "data-slot": "navigation-menu-trigger", className: cn(navigationMenuTriggerStyle(), 'group', className), ...props, children: [children, ' ', _jsx(ChevronDownIcon, { className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180", "aria-hidden": "true" })] }));
|
|
19
|
+
}
|
|
20
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
21
|
+
return (_jsx(NavigationMenuPrimitive.Content, { "data-slot": "navigation-menu-content", className: cn('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 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out top-0 left-0 w-full p-1 md:absolute md:w-auto', 'group-data-[viewport=false]/navigation-menu:bg-background group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow-xs group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none', className), ...props, children: _jsx("div", { className: "bg-muted dark:bg-popover/50 rounded-sm p-0.5", children: props.children }) }));
|
|
22
|
+
}
|
|
23
|
+
function NavigationMenuViewport({ className, ...props }) {
|
|
24
|
+
return (_jsx("div", { className: cn('absolute top-full left-0 isolate z-50 flex justify-center'), children: _jsx(NavigationMenuPrimitive.Viewport, { "data-slot": "navigation-menu-viewport", className: cn('origin-top-center bg-popover text-popover-foreground data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]', className), ...props }) }));
|
|
25
|
+
}
|
|
26
|
+
function NavigationMenuLink({ className, ...props }) {
|
|
27
|
+
return (_jsx(NavigationMenuPrimitive.Link, { "data-slot": "navigation-menu-link", className: cn("hover:bg-popover dark:hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function NavigationMenuSeparator({ className, orientation = 'horizontal', decorative = true, ...props }) {
|
|
30
|
+
return (_jsx(SeparatorPrimitive.Root, { "data-slot": "navigation-menu-separator", decorative: decorative, orientation: orientation, className: cn('bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch', className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function NavigationMenuIndicator({ className, ...props }) {
|
|
33
|
+
return (_jsx(NavigationMenuPrimitive.Indicator, { "data-slot": "navigation-menu-indicator", className: cn('data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden', className), ...props, children: _jsx("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow" }) }));
|
|
34
|
+
}
|
|
35
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuSeparator, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuViewport, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standardized search bar for page-level search/filter.
|
|
3
|
+
* Use on workspace, service-manager, connectors, tunnel, scheduled-tasks, etc.
|
|
4
|
+
*/
|
|
5
|
+
declare function PageSearchBar({ value, onChange, placeholder, className, }: {
|
|
6
|
+
value: string;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export { PageSearchBar };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
import { MagnifyingGlassIcon as Search, XIcon as X } from '@phosphor-icons/react';
|
|
6
|
+
/**
|
|
7
|
+
* Standardized search bar for page-level search/filter.
|
|
8
|
+
* Use on workspace, service-manager, connectors, tunnel, scheduled-tasks, etc.
|
|
9
|
+
*/
|
|
10
|
+
function PageSearchBar({ value, onChange, placeholder = 'Search...', className, }) {
|
|
11
|
+
return (_jsxs("div", { className: cn('group relative flex-1', className), children: [_jsx("input", { type: "text", autoComplete: "off", placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value), className: "border-input bg-card ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring/50 h-9 w-full rounded-2xl border pr-8 pl-9 text-sm transition-colors focus-visible:ring-2 focus-visible:outline-none" }), _jsx("div", { className: "text-muted-foreground group-focus-within:text-primary pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 transition-colors", children: _jsx(Search, { className: "h-3.5 w-3.5" }) }), value && (_jsx(Button, { onClick: () => onChange(''), variant: "ghost", size: "icon-xs", className: "absolute top-1/2 right-2 -translate-y-1/2", children: _jsx(X, { className: "h-3.5 w-3.5" }) }))] }));
|
|
12
|
+
}
|
|
13
|
+
export { PageSearchBar };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RPNInput from 'react-phone-number-input';
|
|
3
|
+
type PhoneInputProps = Omit<React.ComponentProps<'input'>, 'onChange' | 'value' | 'ref'> & Omit<RPNInput.Props<typeof RPNInput.default>, 'onChange'> & {
|
|
4
|
+
onChange?: (value: RPNInput.Value) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps>;
|
|
7
|
+
export { PhoneInput };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CheckIcon, CaretUpDownIcon as ChevronsUpDown } from '@phosphor-icons/react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as RPNInput from 'react-phone-number-input';
|
|
5
|
+
import flags from 'react-phone-number-input/flags';
|
|
6
|
+
import { Button } from './button.js';
|
|
7
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from './command.js';
|
|
8
|
+
import { Input } from './input.js';
|
|
9
|
+
import { Popover, PopoverContent, PopoverTrigger } from './popover.js';
|
|
10
|
+
import { ScrollArea } from './scroll-area.js';
|
|
11
|
+
import { cn } from '../../lib/utils.js';
|
|
12
|
+
const PhoneInput = React.forwardRef(({ className, onChange, value, ...props }, ref) => {
|
|
13
|
+
const isInvalid = props['aria-invalid'] === true || props['aria-invalid'] === 'true';
|
|
14
|
+
return (_jsx(RPNInput.default, { ref: ref, className: cn('flex h-10 gap-2', isInvalid && 'motion-safe:animate-shake', isInvalid && 'motion-safe:animate-shake', className), flagComponent: FlagComponent, countrySelectComponent: CountrySelect, inputComponent: InputComponent, smartCaret: false, value: value || undefined,
|
|
15
|
+
/**
|
|
16
|
+
* Handles the onChange event.
|
|
17
|
+
*
|
|
18
|
+
* react-phone-number-input might trigger the onChange event as undefined
|
|
19
|
+
* when a valid phone number is not entered. To prevent this,
|
|
20
|
+
* the value is coerced to an empty string.
|
|
21
|
+
*
|
|
22
|
+
* @param {E164Number | undefined} value - The entered value
|
|
23
|
+
*/
|
|
24
|
+
onChange: (value) => onChange?.(value || ''), ...props }));
|
|
25
|
+
});
|
|
26
|
+
PhoneInput.displayName = 'PhoneInput';
|
|
27
|
+
const InputComponent = React.forwardRef(({ className, ...props }, ref) => (_jsx(Input, { type: "text",
|
|
28
|
+
// The wrapper owns the shake — a second one here would compound the translate.
|
|
29
|
+
size: "md",
|
|
30
|
+
// The wrapper owns the shake — a second one here would compound the translate.
|
|
31
|
+
className: cn('aria-invalid:animate-none!! aria-invalid:animate-none', className), ...props, ref: ref })));
|
|
32
|
+
InputComponent.displayName = 'InputComponent';
|
|
33
|
+
const CountrySelect = ({ disabled, value: selectedCountry, options: countryList, onChange, }) => {
|
|
34
|
+
const scrollAreaRef = React.useRef(null);
|
|
35
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
36
|
+
return (_jsxs(Popover, { open: isOpen, modal: true, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "outline", className: cn('border-border bg-input flex h-10 items-center gap-1 rounded-md px-3', {
|
|
37
|
+
'cursor-not-allowed opacity-50': disabled,
|
|
38
|
+
}), disabled: disabled, children: [_jsx(FlagComponent, { country: selectedCountry, countryName: selectedCountry }), _jsx(ChevronsUpDown, { className: cn('h-4 w-4 opacity-50', disabled ? 'hidden' : 'flex') })] }) }), _jsx(PopoverContent, { className: "w-[300px] p-0", children: _jsxs(Command, { filter: (value, search) => {
|
|
39
|
+
const searchLower = search.toLowerCase();
|
|
40
|
+
const valueLower = value.toLowerCase();
|
|
41
|
+
// Check if search matches country name, calling code, or country code
|
|
42
|
+
if (valueLower.includes(searchLower)) {
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
return 0;
|
|
46
|
+
}, children: [_jsx(CommandInput, { placeholder: "Search country..." }), _jsx(CommandList, { children: _jsxs(ScrollArea, { ref: scrollAreaRef, className: "h-72", children: [_jsx(CommandEmpty, { children: "No country found." }), _jsx(CommandGroup, { children: countryList.map(({ value, label }) => value ? (_jsx(CountrySelectOption, { country: value, countryName: label, selectedCountry: selectedCountry, onChange: onChange, onSelectComplete: () => setIsOpen(false) }, value)) : null) })] }) })] }) })] }));
|
|
47
|
+
};
|
|
48
|
+
const CountrySelectOption = ({ country, countryName, selectedCountry, onChange, onSelectComplete, }) => {
|
|
49
|
+
const handleSelect = () => {
|
|
50
|
+
onChange(country);
|
|
51
|
+
onSelectComplete();
|
|
52
|
+
};
|
|
53
|
+
return (_jsxs(CommandItem, { className: "gap-2", onSelect: handleSelect, value: `${countryName} +${RPNInput.getCountryCallingCode(country)} ${country}`, children: [_jsx(FlagComponent, { country: country, countryName: countryName }), _jsx("span", { className: "flex-1 text-sm", children: countryName }), _jsx("span", { className: "text-foreground/50 text-sm", children: `+${RPNInput.getCountryCallingCode(country)}` }), _jsx(CheckIcon, { className: cn('ml-auto size-4', country === selectedCountry ? 'opacity-100' : 'opacity-0') })] }));
|
|
54
|
+
};
|
|
55
|
+
const FlagComponent = ({ country, countryName, }) => {
|
|
56
|
+
const Flag = flags[country];
|
|
57
|
+
return (_jsx("span", { className: "bg-foreground/20 flex h-4 w-6 overflow-hidden rounded-sm [&_svg:not([class*='size-'])]:size-full", children: Flag && _jsx(Flag, { title: countryName ?? '' }) }));
|
|
58
|
+
};
|
|
59
|
+
export { PhoneInput };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The Kortix symbol (`kortix-logo.tsx`, `variant="icon"`) sampled onto a
|
|
4
|
+
* 12 × 10 grid. `#` is a cell the symbol fully covers; `+` is a cell on a curve
|
|
5
|
+
* that it only partly covers, drawn as a checker so the curves read as dither.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PIXEL_KORTIX_ROWS: readonly ["## ## ##", "## ## ##", "+#+ ## +#+", " ##+ ## +## ", " ######## ", " ######## ", " ##+ ## +## ", "+#+ ## +#+", "## ## ##", "## ## ##"];
|
|
8
|
+
/**
|
|
9
|
+
* Decorative pixel art of the Kortix symbol, for empty states. It paints in
|
|
10
|
+
* `currentColor`, so the caller sets the tone. It is always `aria-hidden`: the
|
|
11
|
+
* text next to it carries the meaning.
|
|
12
|
+
*/
|
|
13
|
+
export declare function PixelKortixMark({ className, ...props }: ComponentPropsWithoutRef<'svg'>): import("react").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
/**
|
|
6
|
+
* The Kortix symbol (`kortix-logo.tsx`, `variant="icon"`) sampled onto a
|
|
7
|
+
* 12 × 10 grid. `#` is a cell the symbol fully covers; `+` is a cell on a curve
|
|
8
|
+
* that it only partly covers, drawn as a checker so the curves read as dither.
|
|
9
|
+
*/
|
|
10
|
+
export const PIXEL_KORTIX_ROWS = [
|
|
11
|
+
'## ## ##',
|
|
12
|
+
'## ## ##',
|
|
13
|
+
'+#+ ## +#+',
|
|
14
|
+
' ##+ ## +## ',
|
|
15
|
+
' ######## ',
|
|
16
|
+
' ######## ',
|
|
17
|
+
' ##+ ## +## ',
|
|
18
|
+
'+#+ ## +#+',
|
|
19
|
+
'## ## ##',
|
|
20
|
+
'## ## ##',
|
|
21
|
+
];
|
|
22
|
+
/** Cell size and the gap after it, in viewBox units. At the default size one
|
|
23
|
+
* unit is one CSS pixel, so cells and the 1px checker land on whole pixels. */
|
|
24
|
+
const CELL = 5;
|
|
25
|
+
const GAP = 1;
|
|
26
|
+
const PITCH = CELL + GAP;
|
|
27
|
+
const WIDTH = PIXEL_KORTIX_ROWS[0].length * PITCH - GAP;
|
|
28
|
+
const HEIGHT = PIXEL_KORTIX_ROWS.length * PITCH - GAP;
|
|
29
|
+
const CELLS = PIXEL_KORTIX_ROWS.flatMap((row, y) => [...row].flatMap((cell, x) => cell === ' ' ? [] : [{ key: `${x}-${y}`, x: x * PITCH, y: y * PITCH, dithered: cell === '+' }]));
|
|
30
|
+
/**
|
|
31
|
+
* Decorative pixel art of the Kortix symbol, for empty states. It paints in
|
|
32
|
+
* `currentColor`, so the caller sets the tone. It is always `aria-hidden`: the
|
|
33
|
+
* text next to it carries the meaning.
|
|
34
|
+
*/
|
|
35
|
+
export function PixelKortixMark({ className, ...props }) {
|
|
36
|
+
// One pattern per instance: a `url(#id)` that points into another copy of
|
|
37
|
+
// this SVG stops painting when that copy is hidden with `display: none`.
|
|
38
|
+
const ditherId = `pixel-kortix-dither-${useId().replace(/[^\w-]/g, '')}`;
|
|
39
|
+
return (_jsxs("svg", { viewBox: `0 0 ${WIDTH} ${HEIGHT}`, width: WIDTH, height: HEIGHT, fill: "currentColor", shapeRendering: "crispEdges", "aria-hidden": true, className: cn('shrink-0', className), ...props, children: [_jsx("defs", { children: _jsxs("pattern", { id: ditherId, width: "2", height: "2", patternUnits: "userSpaceOnUse", children: [_jsx("rect", { width: "1", height: "1" }), _jsx("rect", { x: "1", y: "1", width: "1", height: "1" })] }) }), CELLS.map((cell) => (_jsx("rect", { x: cell.x, y: cell.y, width: CELL, height: CELL, fill: cell.dithered ? `url(#${ditherId})` : undefined }, cell.key)))] }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { type TriggerVariantProps } from './trigger-variants.js';
|
|
4
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare function PopoverTrigger({ className, variant, size, asChild, ...props }: Omit<React.ComponentProps<typeof PopoverPrimitive.Trigger>, 'size'> & TriggerVariantProps): React.JSX.Element;
|
|
6
|
+
declare function PopoverContent({ className, align, sideOffset, container, style, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content> & {
|
|
7
|
+
container?: HTMLElement;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
10
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
import { floatingZ, useDialogDepth } from '../../lib/z-stack.js';
|
|
6
|
+
import { FLOATING_PANEL_SURFACE } from './menu-recipe.js';
|
|
7
|
+
import { triggerVariants } from './trigger-variants.js';
|
|
8
|
+
/**
|
|
9
|
+
* The surface comes from `FLOATING_PANEL_SURFACE`, shared with the dropdown,
|
|
10
|
+
* context menu and select — a popover is the same card, so it should not have
|
|
11
|
+
* its own background, border, radius or shadow.
|
|
12
|
+
*
|
|
13
|
+
* No enter/exit animation, the same as `DropdownMenuContent`: the panel paints
|
|
14
|
+
* on the frame it mounts and unmounts on the frame it closes. See
|
|
15
|
+
* `dropdown-menu.tsx` for why.
|
|
16
|
+
*
|
|
17
|
+
* What stays local is what a popover holds rather than what it is: `p-4`
|
|
18
|
+
* because the content is prose and controls rather than a list of `p-1` rows,
|
|
19
|
+
* a `w-72` default, and `outline-hidden` because Radix focuses the panel itself
|
|
20
|
+
* on open and the ring would trace the whole card.
|
|
21
|
+
*/
|
|
22
|
+
const POPOVER_PANEL = cn(FLOATING_PANEL_SURFACE, 'w-72 p-4 outline-hidden');
|
|
23
|
+
function Popover({ ...props }) {
|
|
24
|
+
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
25
|
+
}
|
|
26
|
+
function PopoverTrigger({ className, variant, size, asChild, ...props }) {
|
|
27
|
+
return (_jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", asChild: asChild,
|
|
28
|
+
// With `asChild` the child owns its styling — merging ours would double it.
|
|
29
|
+
className: asChild ? className : cn(triggerVariants({ variant, size }), className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function PopoverContent({ className, align = 'center', sideOffset = 4, container, style, ...props }) {
|
|
32
|
+
const depth = useDialogDepth();
|
|
33
|
+
return (_jsx(PopoverPrimitive.Portal, { container: container, children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn(POPOVER_PANEL, className), style: { zIndex: floatingZ(depth), ...style }, ...props }) }));
|
|
34
|
+
}
|
|
35
|
+
function PopoverAnchor({ ...props }) {
|
|
36
|
+
return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
37
|
+
}
|
|
38
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getPortalRoot } from '../../lib/portal-root.js';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
export function Portal({ children }) {
|
|
5
|
+
const [mounted, setMounted] = useState(false);
|
|
6
|
+
const [container, setContainer] = useState(null);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setMounted(true);
|
|
9
|
+
setContainer(getPortalRoot());
|
|
10
|
+
return () => setMounted(false);
|
|
11
|
+
}, []);
|
|
12
|
+
if (!mounted || !container)
|
|
13
|
+
return null;
|
|
14
|
+
return createPortal(children, container);
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const PreviewImage: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const PreviewImageTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PreviewImagePortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const PreviewImageClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const PreviewImageOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
interface PreviewImageContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
9
|
+
fileContent?: string;
|
|
10
|
+
fileName?: string;
|
|
11
|
+
fullscreen?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const PreviewImageContent: React.ForwardRefExoticComponent<PreviewImageContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export { PreviewImage, PreviewImageClose, PreviewImageContent, PreviewImageOverlay, PreviewImagePortal, PreviewImageTrigger, };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
import * as VisuallyHidden from '@radix-ui/react-visually-hidden';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { Close } from '../../icons/close.js';
|
|
7
|
+
import { cn } from '../../lib/utils.js';
|
|
8
|
+
import { Button } from './button.js';
|
|
9
|
+
const PreviewImage = DialogPrimitive.Root;
|
|
10
|
+
const PreviewImageTrigger = DialogPrimitive.Trigger;
|
|
11
|
+
const PreviewImagePortal = DialogPrimitive.Portal;
|
|
12
|
+
const PreviewImageClose = DialogPrimitive.Close;
|
|
13
|
+
const PreviewImageOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn('fixed inset-0 z-50 bg-black/40', className), ...props })));
|
|
14
|
+
PreviewImageOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
15
|
+
const MIN_ZOOM = 0.7;
|
|
16
|
+
const DEFAULT_ZOOM = 1;
|
|
17
|
+
const MAX_ZOOM = 2;
|
|
18
|
+
const ZOOM_STEP = 0.1;
|
|
19
|
+
const DEFAULT_ORIGIN = '50% 50%';
|
|
20
|
+
const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
21
|
+
const PreviewImageContent = React.forwardRef(({ className, fileContent, fileName, ...props }, ref) => {
|
|
22
|
+
const [zoomLevel, setZoomLevel] = React.useState(DEFAULT_ZOOM);
|
|
23
|
+
const [transformOrigin, setTransformOrigin] = React.useState(DEFAULT_ORIGIN);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
setZoomLevel(DEFAULT_ZOOM);
|
|
26
|
+
setTransformOrigin(DEFAULT_ORIGIN);
|
|
27
|
+
}, [fileContent]);
|
|
28
|
+
const getTransformOrigin = (event) => {
|
|
29
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
30
|
+
if (!rect.width || !rect.height) {
|
|
31
|
+
return DEFAULT_ORIGIN;
|
|
32
|
+
}
|
|
33
|
+
const x = ((event.clientX - rect.left) / rect.width) * 100;
|
|
34
|
+
const y = ((event.clientY - rect.top) / rect.height) * 100;
|
|
35
|
+
const xPercent = clamp(x, 0, 100);
|
|
36
|
+
const yPercent = clamp(y, 0, 100);
|
|
37
|
+
return `${xPercent}% ${yPercent}%`;
|
|
38
|
+
};
|
|
39
|
+
const handleWheelZoom = (event) => {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
setTransformOrigin(getTransformOrigin(event));
|
|
42
|
+
setZoomLevel((currentZoom) => {
|
|
43
|
+
const nextZoom = event.deltaY < 0 ? currentZoom + ZOOM_STEP : currentZoom - ZOOM_STEP;
|
|
44
|
+
return clamp(Number(nextZoom.toFixed(1)), MIN_ZOOM, MAX_ZOOM);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const handleImageClick = (event) => {
|
|
48
|
+
setTransformOrigin(getTransformOrigin(event));
|
|
49
|
+
setZoomLevel((currentZoom) => (currentZoom > DEFAULT_ZOOM ? DEFAULT_ZOOM : MAX_ZOOM));
|
|
50
|
+
};
|
|
51
|
+
return (_jsxs(PreviewImagePortal, { children: [_jsx(PreviewImageOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn('fixed top-[50%] left-[50%] z-[99999] grid h-full w-full -translate-x-1/2 -translate-y-1/2 items-center justify-center gap-4 shadow-lg duration-200 sm:rounded-lg', className), ...props, children: [_jsx(VisuallyHidden.Root, { children: _jsx(DialogPrimitive.Title, { children: "Image preview" }) }), _jsx("div", { className: "absolute top-3 right-3 z-[60] flex gap-1", onClick: (event) => event.stopPropagation(), children: _jsx(PreviewImageClose, { asChild: true, children: _jsx(Button, { size: "icon", type: "button", "aria-label": "Close image preview", className: "text-background", children: _jsx(Close, { className: "size-4" }) }) }) }), _jsx("div", { className: "flex h-full max-h-[100vh] w-[100vw] items-center justify-center overflow-auto", onWheel: handleWheelZoom, onClick: handleImageClick, children: _jsx("div", { className: cn(zoomLevel > DEFAULT_ZOOM ? 'cursor-zoom-out' : 'cursor-zoom-in'), style: {
|
|
52
|
+
transform: `scale(${zoomLevel})`,
|
|
53
|
+
transformOrigin,
|
|
54
|
+
transition: 'transform 200ms',
|
|
55
|
+
}, children: fileContent ? (_jsx("img", { src: fileContent, alt: fileName || 'Image preview', width: 1920, height: 1080, className: "max-h-[100vh] w-auto object-contain" })) : null }) })] })] }));
|
|
56
|
+
});
|
|
57
|
+
PreviewImageContent.displayName = DialogPrimitive.Content.displayName;
|
|
58
|
+
export { PreviewImage, PreviewImageClose, PreviewImageContent, PreviewImageOverlay, PreviewImagePortal, PreviewImageTrigger, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/utils.js';
|
|
3
|
+
const R = 7;
|
|
4
|
+
const CIRCUMFERENCE = 2 * Math.PI * R;
|
|
5
|
+
export function ProgressRing({ value, className, trackClassName = 'text-foreground/10', progressClassName = 'text-muted-foreground', }) {
|
|
6
|
+
const clamped = Math.max(0, Math.min(100, value));
|
|
7
|
+
const offset = CIRCUMFERENCE * (1 - clamped / 100);
|
|
8
|
+
return (_jsxs("svg", { viewBox: "0 0 18 18", className: cn('size-4 -rotate-90', className), fill: "none", children: [_jsx("circle", { cx: "9", cy: "9", r: R, stroke: "currentColor", strokeWidth: "2", className: trackClassName }), _jsx("circle", { cx: "9", cy: "9", r: R, stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: cn('transition-[stroke-dashoffset] duration-500', progressClassName), strokeDasharray: CIRCUMFERENCE, strokeDashoffset: offset })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Progress({ className, indicatorClassName, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root> & {
|
|
4
|
+
indicatorClassName?: string;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export { Progress };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
function Progress({ className, indicatorClassName, value, ...props }) {
|
|
6
|
+
return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", className: cn('bg-primary/20 relative h-3 w-full overflow-hidden rounded-full', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: cn('bg-primary h-full w-full flex-1 transition-transform duration-300 ease-out', indicatorClassName), style: { transform: `translateX(-${100 - (value || 0)}%)` } }) }));
|
|
7
|
+
}
|
|
8
|
+
export { Progress };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
type RadioGroupItemProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
variant?: 'default' | 'outline';
|
|
9
|
+
};
|
|
10
|
+
declare function RadioGroupItem({ className, label, description, id, disabled, size, variant, ...props }: RadioGroupItemProps): React.JSX.Element;
|
|
11
|
+
export { RadioGroup, RadioGroupItem };
|
|
12
|
+
export type { RadioGroupItemProps };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../../lib/utils.js';
|
|
6
|
+
function RadioGroup({ className, ...props }) {
|
|
7
|
+
return (_jsx(RadioGroupPrimitive.Root, { "data-slot": "radio-group", className: cn('grid gap-1', className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
const radioControlClassName = cn('peer aspect-square size-4 shrink-0 rounded-full border border-muted-foreground/60 bg-transparent', 'transition-[color,box-shadow,border-color,background-color]', 'outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background', 'disabled:cursor-not-allowed disabled:opacity-50', 'data-[state=checked]:border-foreground data-[state=checked]:bg-background data-[state=checked]:border-kortix-blue data-[state=checked]:border-4 ', 'aria-invalid:border-destructive');
|
|
10
|
+
function RadioGroupItem({ className, label, description, id, disabled, size = 'md', variant = 'default', ...props }) {
|
|
11
|
+
const generatedId = React.useId();
|
|
12
|
+
const itemId = id ?? generatedId;
|
|
13
|
+
const hasCaption = label != null || description != null;
|
|
14
|
+
const control = (_jsx(RadioGroupPrimitive.Item, { "data-slot": "radio-group-item", id: itemId, disabled: disabled, className: cn(radioControlClassName, !hasCaption && className, description != null && 'mt-[3px]'), ...props }));
|
|
15
|
+
if (!hasCaption) {
|
|
16
|
+
return control;
|
|
17
|
+
}
|
|
18
|
+
return (_jsxs("label", { htmlFor: itemId, className: cn('flex w-full cursor-pointer gap-3 rounded-md px-3 py-1.5 transition-colors', description != null ? 'items-start justify-start' : 'items-center justify-center', 'hover:bg-foreground/3', 'has-data-[state=checked]:bg-foreground/6 has-data-[state=checked]:hover:bg-foreground/6', 'has-focus-visible:ring-ring has-focus-visible:ring-offset-background has-focus-visible:ring-2 has-focus-visible:ring-offset-2', disabled && 'cursor-not-allowed opacity-50', className, size === 'sm' && 'px-2 py-1.5', size === 'md' && 'px-3 py-1.5', size === 'lg' && 'px-4 py-2.5', variant === 'outline' && 'border-border border'), children: [control, _jsxs("div", { className: cn('flex min-w-0 flex-1 flex-col', description != null ? 'justify-start' : 'justify-center'), children: [label != null && (_jsx("span", { className: cn('text-sm transition-[color,font-weight]', 'text-foreground', 'peer-data-[state=checked]:text-foreground peer-data-[state=checked]:font-medium', disabled && 'text-muted-foreground'), children: label })), description != null && (_jsx("span", { "data-slot": "radio-group-item-description", className: "text-muted-foreground block text-[13px]", children: description }))] })] }));
|
|
19
|
+
}
|
|
20
|
+
export { RadioGroup, RadioGroupItem };
|