@kortix/ui 0.0.0-stage → 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 +155 -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 +881 -4
- package/skills/kortix-ui/SKILL.md +150 -0
package/README.md
CHANGED
|
@@ -1,3 +1,156 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kortix/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The shared React component library for `apps/web`, Kortix Apps, the
|
|
4
|
+
white-label demo and SDK hosts. Components are Tailwind v4 class strings themed
|
|
5
|
+
by CSS variables. Every `apps/web/src/components/ui/<name>` file lives here as
|
|
6
|
+
`src/components/ui/<name>.tsx`; `apps/web` keeps a one-line re-export shim at
|
|
7
|
+
each old path.
|
|
8
|
+
|
|
9
|
+
Install: not on npm yet. Inside kortix-ai/suna: `"@kortix/ui": "workspace:*"`.
|
|
10
|
+
After the first npm release: `npm i @kortix/ui`.
|
|
11
|
+
`react` and `react-dom` 18 or later are peers.
|
|
12
|
+
|
|
13
|
+
- Public docs: `apps/web/content/docs/sdk/ui.mdx` (https://kortix.com/docs/sdk/ui).
|
|
14
|
+
- Agent skill: `skills/kortix-ui/SKILL.md`. Kortix sessions load the same file
|
|
15
|
+
from `packages/starter/templates/managed/skills/kortix-ui/SKILL.md`
|
|
16
|
+
(`kortix-ui` is in `KORTIX_MANAGED_SKILL_NAMES`, so the sandbox bake ships it).
|
|
17
|
+
`src/skill.test.ts` fails when the copies differ or when the skill's
|
|
18
|
+
Components table misses an export of `src/index.ts` or `src/chat/index.ts`.
|
|
19
|
+
- Live catalog: the `/design-system` route of `apps/web`.
|
|
20
|
+
|
|
21
|
+
## Use it
|
|
22
|
+
|
|
23
|
+
Tailwind host (apps/web, a Vite App with Tailwind):
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
@import 'tailwindcss';
|
|
27
|
+
@import '@kortix/ui/tailwind.css';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Install the plugins `tailwind.css` loads (optional peers, so a host without
|
|
31
|
+
Tailwind never installs Tailwind):
|
|
32
|
+
`npm i tw-animate-css tailwind-scrollbar tailwind-scrollbar-hide`.
|
|
33
|
+
|
|
34
|
+
`tailwind.css` imports `tw-animate-css`, `tokens.css` (the `:root` / `.dark`
|
|
35
|
+
values), `theme.css` (dark variant, base rules, `@theme` keys, utilities,
|
|
36
|
+
keyframes, `@source` over the package) and the `tailwind-scrollbar` plugins.
|
|
37
|
+
A host that brings its own token values imports the parts one by one. Every
|
|
38
|
+
line except `tokens.css` is required: without `tw-animate-css` and the plugins,
|
|
39
|
+
overlay animations and `scrollbar-hide` drop out with no build error.
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
@import 'tailwindcss';
|
|
43
|
+
@import 'tw-animate-css';
|
|
44
|
+
@import '@kortix/ui/tokens.css'; /* optional */
|
|
45
|
+
@import '@kortix/ui/theme.css';
|
|
46
|
+
@plugin 'tailwind-scrollbar';
|
|
47
|
+
@plugin 'tailwind-scrollbar-hide';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`tokens.css` sets `--spacing: 0.23rem`, 8% tighter than Tailwind's `0.25rem`.
|
|
51
|
+
The host's own spacing utilities follow it (`p-4` is 14.72px). To keep stock
|
|
52
|
+
Tailwind spacing, set `--spacing: 0.25rem` after the import; the components
|
|
53
|
+
then render 8% larger.
|
|
54
|
+
|
|
55
|
+
`theme.css` holds the base rules every host needs: `body` paints
|
|
56
|
+
`--background` / `--foreground`, `*` borders default to `--border`,
|
|
57
|
+
`color-scheme` follows `.dark`, `::selection` reads `--selection`, and
|
|
58
|
+
interactive elements get the pointer cursor.
|
|
59
|
+
|
|
60
|
+
Host without Tailwind: `import '@kortix/ui/styles.css'`. It is
|
|
61
|
+
`dist/styles.css`, committed and rebuilt by `pnpm --filter @kortix/ui
|
|
62
|
+
build:styles` after any change under `src/`. `src/exports.test.ts` fails when
|
|
63
|
+
the committed file drifts from a fresh build.
|
|
64
|
+
|
|
65
|
+
Kortix-owned surfaces only (brand D8a): `@import '@kortix/ui/fonts.css';`
|
|
66
|
+
after `theme.css` loads Roobert and sets `--font-roobert` /
|
|
67
|
+
`--font-roobert-mono`. A white-label host never imports it.
|
|
68
|
+
|
|
69
|
+
Mount the adapters once at the root:
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { UiProvider } from '@kortix/ui';
|
|
73
|
+
<UiProvider strings={{ confirm: t('confirm'), chat: { send: t('send') } }} link={NextLink}>{app}</UiProvider>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`strings` takes any subset of `UiStrings`: `confirm`, `cancel`, `close`,
|
|
77
|
+
`commandPaletteTitle`, `commandPaletteDescription`, and `chat` (every string
|
|
78
|
+
of `@kortix/ui/chat`; `defaultChatStrings` lists the keys). Without
|
|
79
|
+
`UiProvider`, components render English copy and a plain `<a>`.
|
|
80
|
+
`MermaidRenderer`'s controls are English only.
|
|
81
|
+
Dark mode is the `dark` class on `<html>` (`useIsDark()` reads it).
|
|
82
|
+
|
|
83
|
+
Import components by subpath: `import { Button } from '@kortix/ui/button'`.
|
|
84
|
+
The root `@kortix/ui` barrel holds only light core primitives. Toasts need one
|
|
85
|
+
`<Toaster />` from `@kortix/ui/toast` at the root; `IconProvider`
|
|
86
|
+
(`@kortix/ui/icon-provider`) sets the house icon weight.
|
|
87
|
+
|
|
88
|
+
## Chat
|
|
89
|
+
|
|
90
|
+
Every part of `@kortix/ui/chat` needs `@kortix/sdk` and `@tanstack/react-query`
|
|
91
|
+
5 (`@kortix/sdk/react` imports it; it is an optional peer, so npm does not
|
|
92
|
+
warn when it is missing and the bundler fails instead):
|
|
93
|
+
`npm i @kortix/ui @kortix/sdk @tanstack/react-query`, plus one
|
|
94
|
+
`QueryClientProvider`.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { useSession } from '@kortix/sdk/react';
|
|
98
|
+
import { SessionThread } from '@kortix/ui/chat';
|
|
99
|
+
|
|
100
|
+
<SessionThread session={useSession(projectId, sessionId)} />
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`src/chat/index.ts` lists every part (`MessageList`, `MessageView`, `Composer`,
|
|
104
|
+
the prompts, the pickers) for a host that composes its own layout. A fully
|
|
105
|
+
custom transcript uses `renderParts` from `@kortix/sdk/react`.
|
|
106
|
+
|
|
107
|
+
## White-label
|
|
108
|
+
|
|
109
|
+
Override the CSS variables from `tokens.css` in your own `:root` / `.dark`.
|
|
110
|
+
Never fork a component. Roobert (`--font-roobert`) is Kortix-owned surfaces
|
|
111
|
+
only; every other host renders the system stack (`--font-sans-system`).
|
|
112
|
+
|
|
113
|
+
| Variable | What follows it |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| `--kortix-blue` | The accent: checked `Switch` / `Checkbox` / `RadioGroup`, `brand` and `blue` `Button` variants, info `Badge`, `InfoBanner`, `Alert`, status, toast |
|
|
116
|
+
| `--ring` | Focus rings; `--kortix-base`, `--sidebar-ring` and `--sidebar-primary` (sidebar selection) follow it |
|
|
117
|
+
| `--sidebar-primary-foreground` | Text on the sidebar selection |
|
|
118
|
+
| `--foreground`, `--background` | Text, the page, the default `Button` (`bg-foreground text-background`) |
|
|
119
|
+
| `--primary`, `--primary-foreground` | `Progress`, `Slider`, `Calendar` selection, menu row tint, default selection |
|
|
120
|
+
| `--kortix-green`, `--kortix-orange`, `--destructive` | Success, warning, error tones |
|
|
121
|
+
| `--radius`, `--font-sans-system` | Radius, font stack |
|
|
122
|
+
|
|
123
|
+
`apps/whitelabel-demo/src/app/globals.css` is the reference: it sets
|
|
124
|
+
`--kortix-blue` and `--ring` to its brand.
|
|
125
|
+
|
|
126
|
+
## Known issues
|
|
127
|
+
|
|
128
|
+
- React 19: npm prints `ERESOLVE overriding peer dependency` for `cmdk@0.2.1`
|
|
129
|
+
(React 18 peer) and nests `@radix-ui/react-dialog@1.0.0` under it. The install
|
|
130
|
+
succeeds. A host with `strict-peer-dependencies` must allow it. `cmdk` 1.x
|
|
131
|
+
changes the selection model `command.tsx` is tuned to, and `apps/web` imports
|
|
132
|
+
`cmdk` directly, so the upgrade is its own change.
|
|
133
|
+
|
|
134
|
+
## Rules
|
|
135
|
+
|
|
136
|
+
- Values: the `kortix-brand` skill (`.agents/skills/kortix-brand/SKILL.md`).
|
|
137
|
+
The generator is `.agents/skills/kortix-brand/scripts/generate-tokens.ts`.
|
|
138
|
+
- Components: the `kortix-design-system` skill.
|
|
139
|
+
- Imports inside the package are relative. Never import `apps/web` code.
|
|
140
|
+
- Edit a component here, never its `apps/web` shim. A shim is only
|
|
141
|
+
`export * from '@kortix/ui/<name>'` (plus `'use client'` and the default
|
|
142
|
+
re-export when the component has them).
|
|
143
|
+
- `package.json` `exports` is generated: `pnpm --filter @kortix/ui gen-exports`.
|
|
144
|
+
`src/exports.test.ts` fails on drift and on an export target that does not exist.
|
|
145
|
+
- `src/styles/tokens.css`, `src/styles/fonts.css` and the `theme` region of
|
|
146
|
+
`src/styles/theme.css` are generated. `dist/styles.css` is built. Never edit them by hand.
|
|
147
|
+
|
|
148
|
+
## Checks
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
pnpm --filter @kortix/ui typecheck
|
|
152
|
+
pnpm --filter @kortix/ui test src/exports.test.ts # exports map, targets, dist/styles.css drift
|
|
153
|
+
pnpm --filter @kortix/ui test src/skill.test.ts # skill names every barrel export; managed copy identical
|
|
154
|
+
bun .agents/skills/kortix-brand/scripts/generate-tokens.ts --check
|
|
155
|
+
.agents/skills/kortix-brand/scripts/audit.sh packages/ui/src
|
|
156
|
+
```
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
// ../shared/src/utils/chalk-colors.ts
|
|
2
|
+
function hashLabel(seed) {
|
|
3
|
+
let hash = 0;
|
|
4
|
+
for (let i = 0; i < seed.length; i++) {
|
|
5
|
+
hash = hash * 31 + seed.charCodeAt(i) | 0;
|
|
6
|
+
}
|
|
7
|
+
return Math.abs(hash);
|
|
8
|
+
}
|
|
9
|
+
function chalkColors(label) {
|
|
10
|
+
const hash = hashLabel(label || "?");
|
|
11
|
+
const hue = hash % 360;
|
|
12
|
+
const sat = 35 + hash % 12;
|
|
13
|
+
const lift = (hash >> 3) % 10;
|
|
14
|
+
return {
|
|
15
|
+
background: `hsl(${hue} ${sat}% ${77 + lift}%)`,
|
|
16
|
+
foreground: `hsl(${hue} ${Math.min(sat + 10, 82)}% 27%)`,
|
|
17
|
+
border: `hsl(${hue} ${sat}% ${65 + lift}%)`
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var AVATAR_FILLS = [
|
|
21
|
+
"hsl(220 8% 50%)",
|
|
22
|
+
"hsl(4 46% 53%)",
|
|
23
|
+
"hsl(24 60% 46%)",
|
|
24
|
+
"hsl(46 62% 37%)",
|
|
25
|
+
"hsl(84 42% 37%)",
|
|
26
|
+
"hsl(212 46% 50%)",
|
|
27
|
+
"hsl(275 34% 56%)",
|
|
28
|
+
"hsl(318 40% 52%)"
|
|
29
|
+
];
|
|
30
|
+
var AVATAR_INK = "hsl(0 0% 100%)";
|
|
31
|
+
function avatarFill(seed) {
|
|
32
|
+
return AVATAR_FILLS[hashLabel(seed.trim().toLowerCase() || "?") % AVATAR_FILLS.length];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ../shared/src/project-glyphs.ts
|
|
36
|
+
var PROJECT_GLYPH_GROUPS = [
|
|
37
|
+
{
|
|
38
|
+
label: "Objects",
|
|
39
|
+
names: [
|
|
40
|
+
"Trash",
|
|
41
|
+
"ShoppingCart",
|
|
42
|
+
"Package",
|
|
43
|
+
"Briefcase",
|
|
44
|
+
"Gift",
|
|
45
|
+
"Lightbulb",
|
|
46
|
+
"Wrench",
|
|
47
|
+
"Hammer",
|
|
48
|
+
"Key",
|
|
49
|
+
"Lock",
|
|
50
|
+
"Umbrella",
|
|
51
|
+
"Trophy"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "Shapes",
|
|
56
|
+
names: [
|
|
57
|
+
"Circle",
|
|
58
|
+
"Square",
|
|
59
|
+
"Triangle",
|
|
60
|
+
"Diamond",
|
|
61
|
+
"Hexagon",
|
|
62
|
+
"Star",
|
|
63
|
+
"Heart",
|
|
64
|
+
"Lightning",
|
|
65
|
+
"Spade",
|
|
66
|
+
"Club",
|
|
67
|
+
"Cube",
|
|
68
|
+
"Polygon"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "Files",
|
|
73
|
+
names: [
|
|
74
|
+
"File",
|
|
75
|
+
"FileText",
|
|
76
|
+
"Folder",
|
|
77
|
+
"FolderOpen",
|
|
78
|
+
"Note",
|
|
79
|
+
"Book",
|
|
80
|
+
"Newspaper",
|
|
81
|
+
"Paperclip",
|
|
82
|
+
"Archive",
|
|
83
|
+
"Notebook",
|
|
84
|
+
"Files",
|
|
85
|
+
"FolderPlus"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: "Actions",
|
|
90
|
+
names: [
|
|
91
|
+
"Plus",
|
|
92
|
+
"Minus",
|
|
93
|
+
"Copy",
|
|
94
|
+
"Check",
|
|
95
|
+
"X",
|
|
96
|
+
"Pencil",
|
|
97
|
+
"Bookmark",
|
|
98
|
+
"Eraser",
|
|
99
|
+
"Scissors",
|
|
100
|
+
"LinkSimple",
|
|
101
|
+
"ShareNetwork",
|
|
102
|
+
"Clipboard"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: "Arrows",
|
|
107
|
+
names: [
|
|
108
|
+
"ArrowUp",
|
|
109
|
+
"ArrowDown",
|
|
110
|
+
"ArrowLeft",
|
|
111
|
+
"ArrowRight",
|
|
112
|
+
"ArrowsClockwise",
|
|
113
|
+
"ArrowSquareOut",
|
|
114
|
+
"TrendUp",
|
|
115
|
+
"TrendDown",
|
|
116
|
+
"ArrowsLeftRight",
|
|
117
|
+
"ArrowUUpLeft",
|
|
118
|
+
"ArrowsOut",
|
|
119
|
+
"ArrowsIn"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: "Tech",
|
|
124
|
+
names: [
|
|
125
|
+
"Code",
|
|
126
|
+
"Terminal",
|
|
127
|
+
"Database",
|
|
128
|
+
"Cloud",
|
|
129
|
+
"Cpu",
|
|
130
|
+
"Bug",
|
|
131
|
+
"GitBranch",
|
|
132
|
+
"Rocket",
|
|
133
|
+
"Monitor",
|
|
134
|
+
"DeviceMobile",
|
|
135
|
+
"Keyboard",
|
|
136
|
+
"Robot"
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
label: "Nature",
|
|
141
|
+
names: [
|
|
142
|
+
"Leaf",
|
|
143
|
+
"Tree",
|
|
144
|
+
"Sun",
|
|
145
|
+
"Moon",
|
|
146
|
+
"Drop",
|
|
147
|
+
"Fire",
|
|
148
|
+
"Mountains",
|
|
149
|
+
"Planet",
|
|
150
|
+
"Flower",
|
|
151
|
+
"Cactus",
|
|
152
|
+
"Snowflake",
|
|
153
|
+
"Rainbow"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: "Symbols",
|
|
158
|
+
names: [
|
|
159
|
+
"Hash",
|
|
160
|
+
"At",
|
|
161
|
+
"Percent",
|
|
162
|
+
"Asterisk",
|
|
163
|
+
"Question",
|
|
164
|
+
"Warning",
|
|
165
|
+
"Info",
|
|
166
|
+
"Bell",
|
|
167
|
+
"Crown",
|
|
168
|
+
"Flag",
|
|
169
|
+
"Medal",
|
|
170
|
+
"Sparkle"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
label: "Food",
|
|
175
|
+
names: [
|
|
176
|
+
"Carrot",
|
|
177
|
+
"Pizza",
|
|
178
|
+
"Hamburger",
|
|
179
|
+
"IceCream",
|
|
180
|
+
"Coffee",
|
|
181
|
+
"BeerStein",
|
|
182
|
+
"Cookie",
|
|
183
|
+
"Cake",
|
|
184
|
+
"Egg",
|
|
185
|
+
"Bread",
|
|
186
|
+
"Wine",
|
|
187
|
+
"Martini"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
label: "Animals",
|
|
192
|
+
names: [
|
|
193
|
+
"Dog",
|
|
194
|
+
"Cat",
|
|
195
|
+
"Bird",
|
|
196
|
+
"Butterfly",
|
|
197
|
+
"Rabbit",
|
|
198
|
+
"Horse",
|
|
199
|
+
"Cow",
|
|
200
|
+
"PawPrint",
|
|
201
|
+
"Fish",
|
|
202
|
+
"Shrimp",
|
|
203
|
+
"Feather",
|
|
204
|
+
"Bone"
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
label: "Transport",
|
|
209
|
+
names: [
|
|
210
|
+
"Car",
|
|
211
|
+
"Bus",
|
|
212
|
+
"Truck",
|
|
213
|
+
"Train",
|
|
214
|
+
"Airplane",
|
|
215
|
+
"Bicycle",
|
|
216
|
+
"Motorcycle",
|
|
217
|
+
"Boat",
|
|
218
|
+
"Scooter",
|
|
219
|
+
"Taxi",
|
|
220
|
+
"Van",
|
|
221
|
+
"Jeep"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: "People",
|
|
226
|
+
names: [
|
|
227
|
+
"User",
|
|
228
|
+
"Users",
|
|
229
|
+
"Smiley",
|
|
230
|
+
"SmileyMeh",
|
|
231
|
+
"SmileySad",
|
|
232
|
+
"Ghost",
|
|
233
|
+
"Alien",
|
|
234
|
+
"Baby",
|
|
235
|
+
"PersonSimpleRun",
|
|
236
|
+
"Hand",
|
|
237
|
+
"ThumbsUp",
|
|
238
|
+
"Eye"
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
label: "Music",
|
|
243
|
+
names: [
|
|
244
|
+
"MusicNote",
|
|
245
|
+
"MusicNotes",
|
|
246
|
+
"Guitar",
|
|
247
|
+
"Microphone",
|
|
248
|
+
"SpeakerHigh",
|
|
249
|
+
"Radio",
|
|
250
|
+
"Playlist",
|
|
251
|
+
"Metronome",
|
|
252
|
+
"Waveform",
|
|
253
|
+
"Disc",
|
|
254
|
+
"Headphones",
|
|
255
|
+
"Equalizer"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
label: "Sport",
|
|
260
|
+
names: [
|
|
261
|
+
"Basketball",
|
|
262
|
+
"Football",
|
|
263
|
+
"SoccerBall",
|
|
264
|
+
"Baseball",
|
|
265
|
+
"TennisBall",
|
|
266
|
+
"Barbell",
|
|
267
|
+
"Target",
|
|
268
|
+
"Golf",
|
|
269
|
+
"Volleyball",
|
|
270
|
+
"PingPong",
|
|
271
|
+
"Racquet",
|
|
272
|
+
"PersonSimpleSwim"
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
label: "Money",
|
|
277
|
+
names: [
|
|
278
|
+
"CurrencyDollar",
|
|
279
|
+
"Wallet",
|
|
280
|
+
"CreditCard",
|
|
281
|
+
"PiggyBank",
|
|
282
|
+
"Coins",
|
|
283
|
+
"Receipt",
|
|
284
|
+
"Bank",
|
|
285
|
+
"ChartLine",
|
|
286
|
+
"Tag",
|
|
287
|
+
"ChartBar",
|
|
288
|
+
"ChartPie",
|
|
289
|
+
"Handshake"
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
label: "Care",
|
|
294
|
+
names: [
|
|
295
|
+
"CloudRain",
|
|
296
|
+
"CloudSnow",
|
|
297
|
+
"CloudLightning",
|
|
298
|
+
"Wind",
|
|
299
|
+
"Thermometer",
|
|
300
|
+
"Sunglasses",
|
|
301
|
+
"Heartbeat",
|
|
302
|
+
"Pill",
|
|
303
|
+
"FirstAid",
|
|
304
|
+
"Syringe",
|
|
305
|
+
"Bandaids",
|
|
306
|
+
"Stethoscope"
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
label: "Numbers",
|
|
311
|
+
names: [
|
|
312
|
+
"NumberCircleZero",
|
|
313
|
+
"NumberCircleOne",
|
|
314
|
+
"NumberCircleTwo",
|
|
315
|
+
"NumberCircleThree",
|
|
316
|
+
"NumberCircleFour",
|
|
317
|
+
"NumberCircleFive",
|
|
318
|
+
"NumberCircleSix",
|
|
319
|
+
"NumberCircleSeven",
|
|
320
|
+
"NumberCircleEight",
|
|
321
|
+
"NumberCircleNine"
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
];
|
|
325
|
+
var PROJECT_GLYPH_NAMES = PROJECT_GLYPH_GROUPS.flatMap(
|
|
326
|
+
(group) => group.names
|
|
327
|
+
);
|
|
328
|
+
var PROJECT_GLYPH_COLORS = [
|
|
329
|
+
"grey",
|
|
330
|
+
"red",
|
|
331
|
+
"orange",
|
|
332
|
+
"yellow",
|
|
333
|
+
"lime",
|
|
334
|
+
"blue",
|
|
335
|
+
"purple",
|
|
336
|
+
"magenta"
|
|
337
|
+
];
|
|
338
|
+
new Set(PROJECT_GLYPH_NAMES);
|
|
339
|
+
new Set(PROJECT_GLYPH_COLORS);
|
|
340
|
+
|
|
341
|
+
export { AVATAR_INK, PROJECT_GLYPH_COLORS, PROJECT_GLYPH_NAMES, avatarFill, chalkColors };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Agent } from '@kortix/sdk';
|
|
2
|
+
export declare function AgentPicker({ agents, value, onChange, defaultName, }: {
|
|
3
|
+
agents: readonly Agent[];
|
|
4
|
+
value: string | null;
|
|
5
|
+
onChange: (name: string | null) => void;
|
|
6
|
+
/** The project's configured default agent, shown when nothing is picked. */
|
|
7
|
+
defaultName?: string | null;
|
|
8
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Agent picker, controlled, over `session.agents`. `value` is the agent name,
|
|
5
|
+
* or null for the project's default agent. Send passes the pick as `options.agent`.
|
|
6
|
+
*/
|
|
7
|
+
import { CaretUpDownIcon, CheckIcon, RobotIcon } from '@phosphor-icons/react';
|
|
8
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '../components/ui/dropdown-menu.js';
|
|
9
|
+
import { MENU_INDICATOR, MENU_INDICATOR_ICON } from '../components/ui/menu-recipe.js';
|
|
10
|
+
import { useUiStrings } from '../providers/ui-provider.js';
|
|
11
|
+
const TRIGGER = 'text-muted-foreground hover:text-foreground h-7 max-w-40 min-w-0 gap-1 px-2 text-xs';
|
|
12
|
+
export function AgentPicker({ agents, value, onChange, defaultName, }) {
|
|
13
|
+
const t = useUiStrings().chat;
|
|
14
|
+
if (agents.length === 0)
|
|
15
|
+
return null;
|
|
16
|
+
const check = (on) => (_jsx("span", { className: MENU_INDICATOR, children: on && _jsx(CheckIcon, { className: MENU_INDICATOR_ICON }) }));
|
|
17
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { variant: "transparent", className: TRIGGER, "aria-label": t.agent, children: [_jsx(RobotIcon, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate capitalize", children: value ?? defaultName ?? t.defaultAgent }), _jsx(CaretUpDownIcon, { className: "size-3 shrink-0" })] }), _jsxs(DropdownMenuContent, { align: "start", className: "w-60", children: [_jsxs(DropdownMenuItem, { onSelect: () => onChange(null), children: [_jsx("span", { className: "flex-1 capitalize", children: defaultName ? t.defaultAgentNamed(defaultName) : t.defaultAgent }), check(!value)] }), agents.map((a) => (_jsxs(DropdownMenuItem, { onSelect: () => onChange(a.name), className: "items-start", children: [_jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate capitalize", children: a.name }), a.description && _jsx("span", { className: "text-muted-foreground block truncate text-xs", children: a.description })] }), check(value === a.name)] }, a.name)))] })] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ChatErrorHandler } from './permission-prompt.js';
|
|
3
|
+
export type ComposerCommand = {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string | null;
|
|
6
|
+
};
|
|
7
|
+
/** The "/token" being typed (no space yet), lower-cased, or null. */
|
|
8
|
+
export declare function slashQuery(value: string): string | null;
|
|
9
|
+
/** A "/name args" line whose name is a known command, else null (send it as text). */
|
|
10
|
+
export declare function parseCommand(text: string, commands: readonly ComposerCommand[]): {
|
|
11
|
+
name: string;
|
|
12
|
+
args: string;
|
|
13
|
+
} | null;
|
|
14
|
+
export declare function Composer({ onSend, onStop, busy, canStop, disabled, placeholder, toolbar, footer, commands, onCommand, onError, }: {
|
|
15
|
+
onSend: (text: string) => void;
|
|
16
|
+
onStop: () => void;
|
|
17
|
+
busy: boolean;
|
|
18
|
+
/** False hides Stop (a shared session where this viewer may not stop the turn). */
|
|
19
|
+
canStop?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Default: `strings.chat.placeholder`. */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
toolbar?: ReactNode;
|
|
24
|
+
/** Rendered under the input card. */
|
|
25
|
+
footer?: ReactNode;
|
|
26
|
+
commands?: readonly ComposerCommand[];
|
|
27
|
+
/** Runs a slash command. A rejection restores the typed line and reports the error. */
|
|
28
|
+
onCommand?: (name: string, args: string) => void | Promise<void>;
|
|
29
|
+
/** Reports a refused command (for a toast). Without it the composer shows the error inline. */
|
|
30
|
+
onError?: ChatErrorHandler;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The chat input card. Enter sends, Shift+Enter adds a line. Typing "/" opens
|
|
5
|
+
* the project's command menu (`session.commands`); a sent "/cmd args" line
|
|
6
|
+
* whose name is a known command runs `onCommand` instead of a text prompt.
|
|
7
|
+
* A refused command is never silent: the typed line comes back into the
|
|
8
|
+
* input and the error goes to `onError`, or shows inline when there is none.
|
|
9
|
+
* While the agent is busy the send button becomes Stop.
|
|
10
|
+
*
|
|
11
|
+
* `toolbar` sits in the card's control row (model and agent pickers).
|
|
12
|
+
* `footer` sits under the card: read-only facts about the session, which
|
|
13
|
+
* would read as send-time options inside the control row.
|
|
14
|
+
*/
|
|
15
|
+
import { ArrowUpIcon, StopIcon, WarningCircleIcon } from '@phosphor-icons/react';
|
|
16
|
+
import { useMemo, useRef, useState } from 'react';
|
|
17
|
+
import { Button } from '../components/ui/button.js';
|
|
18
|
+
import { InfoBanner } from '../components/ui/info-banner.js';
|
|
19
|
+
import { FLOATING_PANEL_SURFACE, menuRow } from '../components/ui/menu-recipe.js';
|
|
20
|
+
import { Textarea } from '../components/ui/textarea.js';
|
|
21
|
+
import { cn } from '../lib/utils.js';
|
|
22
|
+
import { useUiStrings } from '../providers/ui-provider.js';
|
|
23
|
+
import { errorMessage } from './permission-prompt.js';
|
|
24
|
+
/** The "/token" being typed (no space yet), lower-cased, or null. */
|
|
25
|
+
export function slashQuery(value) {
|
|
26
|
+
const m = value.match(/^\/(\S*)$/);
|
|
27
|
+
return m ? m[1].toLowerCase() : null;
|
|
28
|
+
}
|
|
29
|
+
/** A "/name args" line whose name is a known command, else null (send it as text). */
|
|
30
|
+
export function parseCommand(text, commands) {
|
|
31
|
+
const m = text.match(/^\/(\S+)(?:\s+([\s\S]*))?$/);
|
|
32
|
+
if (!m || !commands.some((c) => c.name === m[1]))
|
|
33
|
+
return null;
|
|
34
|
+
return { name: m[1], args: (m[2] ?? '').trim() };
|
|
35
|
+
}
|
|
36
|
+
export function Composer({ onSend, onStop, busy, canStop = true, disabled, placeholder, toolbar, footer, commands, onCommand, onError, }) {
|
|
37
|
+
const t = useUiStrings().chat;
|
|
38
|
+
const [value, setValue] = useState('');
|
|
39
|
+
const [dismissed, setDismissed] = useState(false);
|
|
40
|
+
const [highlight, setHighlight] = useState(0);
|
|
41
|
+
const [commandError, setCommandError] = useState(null);
|
|
42
|
+
const ref = useRef(null);
|
|
43
|
+
const query = slashQuery(value);
|
|
44
|
+
const matches = useMemo(() => {
|
|
45
|
+
if (query === null || !commands?.length || !onCommand)
|
|
46
|
+
return [];
|
|
47
|
+
return commands.filter((c) => c.name.toLowerCase().includes(query)).slice(0, 8);
|
|
48
|
+
}, [query, commands, onCommand]);
|
|
49
|
+
const menuOpen = matches.length > 0 && !dismissed;
|
|
50
|
+
const setText = (next) => {
|
|
51
|
+
setValue(next);
|
|
52
|
+
setDismissed(false);
|
|
53
|
+
setHighlight(0);
|
|
54
|
+
};
|
|
55
|
+
const pickCommand = (name) => {
|
|
56
|
+
setText(`/${name} `);
|
|
57
|
+
ref.current?.focus();
|
|
58
|
+
};
|
|
59
|
+
const runCommand = async (text, name, args) => {
|
|
60
|
+
try {
|
|
61
|
+
await onCommand?.(name, args);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
// Give the line back unless the user already typed a new one.
|
|
65
|
+
setValue((current) => (current === '' ? text : current));
|
|
66
|
+
const message = errorMessage(err, t.commandFailed);
|
|
67
|
+
if (onError)
|
|
68
|
+
onError(message, err);
|
|
69
|
+
else
|
|
70
|
+
setCommandError(message);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const submit = () => {
|
|
74
|
+
const text = value.trim();
|
|
75
|
+
if (!text || disabled)
|
|
76
|
+
return;
|
|
77
|
+
setCommandError(null);
|
|
78
|
+
const command = onCommand ? parseCommand(text, commands ?? []) : null;
|
|
79
|
+
// Clear at once: a command's request can last the whole turn.
|
|
80
|
+
setText('');
|
|
81
|
+
if (command)
|
|
82
|
+
void runCommand(text, command.name, command.args);
|
|
83
|
+
else
|
|
84
|
+
onSend(text);
|
|
85
|
+
};
|
|
86
|
+
return (_jsxs("div", { "data-slot": "composer", className: "relative", children: [commandError && (_jsx(InfoBanner, { tone: "destructive", icon: WarningCircleIcon, title: t.commandFailed, className: "mb-2", role: "alert", children: commandError })), menuOpen && (_jsxs("div", { role: "listbox", "aria-label": t.commands, className: cn(FLOATING_PANEL_SURFACE, 'absolute bottom-full left-0 z-20 mb-2 w-72 overflow-hidden'), children: [_jsx("div", { className: "border-border text-muted-foreground border-b px-3 py-1.5 text-xs", children: t.commands }), _jsx("div", { className: "scrollbar-thin max-h-64 overflow-y-auto p-1", children: matches.map((c, i) => (_jsxs("button", { type: "button", role: "option", "aria-selected": i === highlight, "data-highlighted": i === highlight ? '' : undefined, onMouseEnter: () => setHighlight(i), onClick: () => pickCommand(c.name), className: menuRow('sm', 'default', 'items-start text-left'), children: [_jsx("span", { className: "text-muted-foreground w-4 shrink-0 text-center font-mono", children: "/" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate", children: c.name }), c.description && (_jsx("span", { className: "text-muted-foreground block truncate text-xs", children: c.description }))] })] }, c.name))) })] })), _jsxs("div", { className: cn('border-border bg-popover focus-within:border-ring rounded-lg border transition-colors motion-reduce:transition-none', disabled && 'opacity-70'), children: [_jsx(Textarea, { ref: ref, rows: 1, minHeight: 35, maxHeight: 200, value: value, disabled: disabled, placeholder: placeholder ?? t.placeholder, "aria-label": t.message, onChange: (e) => setText(e.target.value), onKeyDown: (e) => {
|
|
87
|
+
if (e.nativeEvent.isComposing)
|
|
88
|
+
return;
|
|
89
|
+
if (menuOpen) {
|
|
90
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
const step = e.key === 'ArrowDown' ? 1 : -1;
|
|
93
|
+
setHighlight((h) => Math.min(Math.max(h + step, 0), matches.length - 1));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (e.key === 'Enter' || e.key === 'Tab') {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
pickCommand((matches[highlight] ?? matches[0]).name);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (e.key === 'Escape') {
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
setDismissed(true);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
// No new turn while the agent is busy: the visible control is Stop.
|
|
110
|
+
if (!busy)
|
|
111
|
+
submit();
|
|
112
|
+
}
|
|
113
|
+
}, className: "scrollbar-thin border-0 bg-transparent px-3.5 pt-3 leading-relaxed focus:ring-0" }), _jsxs("div", { className: "flex items-center justify-between gap-2 px-2 pt-1 pb-2", children: [_jsx("div", { className: "min-w-0", children: toolbar }), busy && canStop ? (_jsx(Button, { size: "icon-base", variant: "secondary", onClick: onStop, "aria-label": t.stop, className: "rounded-full", children: _jsx(StopIcon, { weight: "fill", className: "size-3.5" }) })) : (_jsx(Button, { size: "icon-base", onClick: submit, disabled: busy || !value.trim() || disabled, "aria-label": t.send, className: "rounded-full", children: _jsx(ArrowUpIcon, { className: "size-4" }) }))] })] }), footer] }));
|
|
114
|
+
}
|