@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,131 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { spring } from '../../lib/springs.js';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
6
|
+
import { animate, m, useMotionValue } from 'motion/react';
|
|
7
|
+
import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
+
// Track is `w-[34px] h-[20px]` in the className — keep it in sync with these.
|
|
9
|
+
const TRACK_WIDTH = 34;
|
|
10
|
+
const THUMB_SIZE = 16;
|
|
11
|
+
const THUMB_OFFSET = 2;
|
|
12
|
+
const THUMB_TRAVEL = TRACK_WIDTH - THUMB_SIZE - THUMB_OFFSET * 2;
|
|
13
|
+
const PILL_EXTEND = 2;
|
|
14
|
+
const PRESS_EXTEND = 4;
|
|
15
|
+
const PRESS_SHRINK = 4;
|
|
16
|
+
const DRAG_DEAD_ZONE = 2;
|
|
17
|
+
const Switch = forwardRef(({ label, checked, onCheckedChange, disabled = false, className, id, ...props }, ref) => {
|
|
18
|
+
const hasMounted = useRef(false);
|
|
19
|
+
const [hovered, setHovered] = useState(false);
|
|
20
|
+
const [pressed, setPressed] = useState(false);
|
|
21
|
+
const isChecked = checked ?? false;
|
|
22
|
+
const dragging = useRef(false);
|
|
23
|
+
const didDrag = useRef(false);
|
|
24
|
+
const pointerStart = useRef(null);
|
|
25
|
+
const motionX = useMotionValue(isChecked ? THUMB_OFFSET + THUMB_TRAVEL : THUMB_OFFSET);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
hasMounted.current = true;
|
|
28
|
+
}, []);
|
|
29
|
+
const thumbWidth = pressed
|
|
30
|
+
? THUMB_SIZE + PRESS_EXTEND
|
|
31
|
+
: hovered
|
|
32
|
+
? THUMB_SIZE + PILL_EXTEND
|
|
33
|
+
: THUMB_SIZE;
|
|
34
|
+
const thumbHeight = pressed ? THUMB_SIZE - PRESS_SHRINK : THUMB_SIZE;
|
|
35
|
+
const thumbY = pressed ? THUMB_OFFSET + PRESS_SHRINK / 2 : THUMB_OFFSET;
|
|
36
|
+
const extraWidth = thumbWidth - THUMB_SIZE;
|
|
37
|
+
const thumbX = isChecked ? THUMB_OFFSET + THUMB_TRAVEL - extraWidth : THUMB_OFFSET;
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (dragging.current)
|
|
40
|
+
return;
|
|
41
|
+
if (!hasMounted.current) {
|
|
42
|
+
motionX.set(thumbX);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
animate(motionX, thumbX, spring.moderate);
|
|
46
|
+
}
|
|
47
|
+
}, [thumbX, motionX]);
|
|
48
|
+
const handlePointerDown = useCallback((e) => {
|
|
49
|
+
if (disabled)
|
|
50
|
+
return;
|
|
51
|
+
if (e.pointerType === 'mouse' && e.button !== 0)
|
|
52
|
+
return;
|
|
53
|
+
setPressed(true);
|
|
54
|
+
dragging.current = false;
|
|
55
|
+
didDrag.current = false;
|
|
56
|
+
pointerStart.current = {
|
|
57
|
+
clientX: e.clientX,
|
|
58
|
+
originX: motionX.get(),
|
|
59
|
+
};
|
|
60
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
61
|
+
}, [disabled, motionX]);
|
|
62
|
+
const handlePointerMove = useCallback((e) => {
|
|
63
|
+
if (!pointerStart.current)
|
|
64
|
+
return;
|
|
65
|
+
const delta = e.clientX - pointerStart.current.clientX;
|
|
66
|
+
if (!dragging.current) {
|
|
67
|
+
if (Math.abs(delta) < DRAG_DEAD_ZONE)
|
|
68
|
+
return;
|
|
69
|
+
dragging.current = true;
|
|
70
|
+
}
|
|
71
|
+
const dragMin = THUMB_OFFSET;
|
|
72
|
+
const pressedThumbWidth = THUMB_SIZE + PRESS_EXTEND;
|
|
73
|
+
const dragMax = TRACK_WIDTH - THUMB_OFFSET - pressedThumbWidth;
|
|
74
|
+
const rawX = pointerStart.current.originX + delta;
|
|
75
|
+
motionX.set(Math.max(dragMin, Math.min(dragMax, rawX)));
|
|
76
|
+
}, [motionX]);
|
|
77
|
+
const handlePointerUp = useCallback(() => {
|
|
78
|
+
if (!pointerStart.current)
|
|
79
|
+
return;
|
|
80
|
+
setPressed(false);
|
|
81
|
+
if (dragging.current) {
|
|
82
|
+
didDrag.current = true;
|
|
83
|
+
dragging.current = false;
|
|
84
|
+
const currentX = motionX.get();
|
|
85
|
+
const dragMin = THUMB_OFFSET;
|
|
86
|
+
const pressedThumbWidth = THUMB_SIZE + PRESS_EXTEND;
|
|
87
|
+
const dragMax = TRACK_WIDTH - THUMB_OFFSET - pressedThumbWidth;
|
|
88
|
+
const midpoint = (dragMin + dragMax) / 2;
|
|
89
|
+
const shouldBeOn = currentX > midpoint;
|
|
90
|
+
if (shouldBeOn !== isChecked) {
|
|
91
|
+
onCheckedChange?.(shouldBeOn);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const snapTarget = isChecked ? THUMB_OFFSET + THUMB_TRAVEL : THUMB_OFFSET;
|
|
95
|
+
animate(motionX, snapTarget, spring.moderate);
|
|
96
|
+
}
|
|
97
|
+
requestAnimationFrame(() => {
|
|
98
|
+
didDrag.current = false;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
pointerStart.current = null;
|
|
102
|
+
}, [isChecked, onCheckedChange, motionX]);
|
|
103
|
+
const switchControl = (_jsx(SwitchPrimitive.Root, { ref: ref, id: id, checked: checked, disabled: disabled, tabIndex: 0, className: cn('group/switch relative h-[20px] w-[34px] shrink-0 touch-none rounded-full outline-none', // pointer comes from the global rule; disabled keeps the default cursor
|
|
104
|
+
'transition-colors duration-80', 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-1 focus-visible:ring-offset-2',
|
|
105
|
+
// Colours come from Radix's `data-state`, never from JS state.
|
|
106
|
+
// Off is translucent ink, so one class reads in both themes and on
|
|
107
|
+
// any panel. Thumb vs track (WCAG 1.4.11, 3:1), worst of page /
|
|
108
|
+
// card / muted: rest 3.13:1, hover 4.13:1. On: white thumb 3.23:1.
|
|
109
|
+
'data-[state=checked]:bg-kortix-blue', 'data-[state=unchecked]:bg-foreground/10 data-[state=unchecked]:hover:bg-foreground/15', !label && className), onPointerEnter: (e) => {
|
|
110
|
+
if (e.pointerType === 'mouse')
|
|
111
|
+
setHovered(true);
|
|
112
|
+
}, onPointerLeave: () => setHovered(false), onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, onCheckedChange: (nextChecked) => {
|
|
113
|
+
if (didDrag.current)
|
|
114
|
+
return;
|
|
115
|
+
onCheckedChange?.(nextChecked);
|
|
116
|
+
}, ...props, children: _jsx(SwitchPrimitive.Thumb, { asChild: true, children: _jsx(m.span, { className: cn('duration-fast absolute top-0 left-0 rounded-full shadow-sm transition-colors', 'data-[state=checked]:bg-white',
|
|
117
|
+
// A white thumb on the light off track would be ~1.25:1.
|
|
118
|
+
'data-[state=unchecked]:bg-foreground/45 group-hover/switch:data-[state=unchecked]:bg-foreground/55'), initial: false,
|
|
119
|
+
// Motion value binding for drag, not a colour or layout style.
|
|
120
|
+
style: { x: motionX }, animate: {
|
|
121
|
+
y: thumbY,
|
|
122
|
+
width: thumbWidth,
|
|
123
|
+
height: thumbHeight,
|
|
124
|
+
}, transition: hasMounted.current ? spring.moderate : { duration: 0 } }) }) }));
|
|
125
|
+
if (!label) {
|
|
126
|
+
return switchControl;
|
|
127
|
+
}
|
|
128
|
+
return (_jsxs("div", { className: cn('relative z-10 flex cursor-pointer items-center gap-2.5 px-3 py-2 select-none', disabled && 'pointer-events-none opacity-50', className), children: [switchControl, _jsx("span", { className: cn('text-sm transition-[color] duration-80', isChecked ? 'text-foreground' : 'text-muted-foreground'), children: label })] }));
|
|
129
|
+
});
|
|
130
|
+
Switch.displayName = 'Switch';
|
|
131
|
+
export { Switch };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const systemMessageVariants: (props?: ({
|
|
4
|
+
variant?: "error" | "warning" | "action" | null | undefined;
|
|
5
|
+
fill?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
/** `cta.variant` is the caller-facing name; this maps it to a Button variant. */
|
|
8
|
+
declare const CTA_BUTTON_VARIANT: {
|
|
9
|
+
readonly solid: "default";
|
|
10
|
+
readonly outline: "outline";
|
|
11
|
+
readonly ghost: "ghost";
|
|
12
|
+
};
|
|
13
|
+
export type SystemMessageProps = React.ComponentProps<'div'> & VariantProps<typeof systemMessageVariants> & {
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
isIconHidden?: boolean;
|
|
16
|
+
cta?: {
|
|
17
|
+
label: string;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
variant?: keyof typeof CTA_BUTTON_VARIANT;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare function SystemMessage({ children, variant, fill, icon, isIconHidden, cta, className, ...props }: SystemMessageProps): React.JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { InfoIcon, WarningCircleIcon, WarningIcon } from '@phosphor-icons/react';
|
|
6
|
+
import { cva } from 'class-variance-authority';
|
|
7
|
+
const systemMessageVariants = cva('flex flex-row items-center gap-3 rounded-md border py-2 pr-2 pl-3', {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
action: 'text-muted-foreground',
|
|
11
|
+
error: 'text-kortix-red',
|
|
12
|
+
warning: 'text-kortix-orange',
|
|
13
|
+
},
|
|
14
|
+
fill: {
|
|
15
|
+
true: 'border-transparent',
|
|
16
|
+
false: '',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
compoundVariants: [
|
|
20
|
+
{ variant: 'action', fill: true, class: 'bg-muted' },
|
|
21
|
+
{ variant: 'error', fill: true, class: 'bg-kortix-red/10' },
|
|
22
|
+
{ variant: 'warning', fill: true, class: 'bg-kortix-orange/10' },
|
|
23
|
+
{ variant: 'action', fill: false, class: 'border-border' },
|
|
24
|
+
{ variant: 'error', fill: false, class: 'border-kortix-red/30' },
|
|
25
|
+
{ variant: 'warning', fill: false, class: 'border-kortix-orange/30' },
|
|
26
|
+
],
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: 'action',
|
|
29
|
+
fill: false,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
/** `cta.variant` is the caller-facing name; this maps it to a Button variant. */
|
|
33
|
+
const CTA_BUTTON_VARIANT = {
|
|
34
|
+
solid: 'default',
|
|
35
|
+
outline: 'outline',
|
|
36
|
+
ghost: 'ghost',
|
|
37
|
+
};
|
|
38
|
+
function defaultIcon(variant) {
|
|
39
|
+
switch (variant) {
|
|
40
|
+
case 'error':
|
|
41
|
+
return _jsx(WarningCircleIcon, { className: "size-4" });
|
|
42
|
+
case 'warning':
|
|
43
|
+
return _jsx(WarningIcon, { className: "size-4" });
|
|
44
|
+
default:
|
|
45
|
+
return _jsx(InfoIcon, { className: "size-4" });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function SystemMessage({ children, variant = 'action', fill = false, icon, isIconHidden = false, cta, className, ...props }) {
|
|
49
|
+
const iconToShow = isIconHidden ? null : (icon ?? defaultIcon(variant));
|
|
50
|
+
return (_jsxs("div", { className: cn(systemMessageVariants({ variant, fill }), className), ...props, children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-row items-center gap-3 leading-normal", children: [iconToShow !== null && (_jsx("div", { className: "flex h-[1lh] shrink-0 items-center justify-center self-start", children: iconToShow })), _jsx("div", { className: "min-w-0 flex-1 text-sm", children: children })] }), cta && (_jsx(Button, { variant: CTA_BUTTON_VARIANT[cta.variant ?? 'solid'], size: "sm", onClick: cta.onClick, children: cta.label }))] }));
|
|
51
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<'table'>): React.JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): React.JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): React.JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): React.JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): React.JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): React.JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): React.JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): React.JSX.Element;
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../../lib/utils.js';
|
|
4
|
+
function Table({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "table-container", className: "border-border bg-popover relative w-full overflow-hidden rounded-md border", children: _jsx("div", { className: "overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn('w-full caption-bottom text-sm', className), ...props }) }) }));
|
|
6
|
+
}
|
|
7
|
+
function TableHeader({ className, ...props }) {
|
|
8
|
+
return (_jsx("thead", { "data-slot": "table-header", className: cn('bg-accent [&_tr]:border-b', className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function TableBody({ className, ...props }) {
|
|
11
|
+
return (_jsx("tbody", { "data-slot": "table-body", className: cn('[&_tr:last-child]:border-0', className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function TableFooter({ className, ...props }) {
|
|
14
|
+
return (_jsx("tfoot", { "data-slot": "table-footer", className: cn('bg-popover-foreground/5 border-t font-medium [&>tr]:last:border-b-0', className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function TableRow({ className, ...props }) {
|
|
17
|
+
return (_jsx("tr", { "data-slot": "table-row", className: cn('hover:bg-popover-foreground/5 data-[state=selected]:bg-popover-foreground/5 border-b transition-colors', className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function TableHead({ className, ...props }) {
|
|
20
|
+
return (_jsx("th", { "data-slot": "table-head", className: cn('text-muted-foreground px-5 py-2 text-left align-middle text-sm font-normal whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]', className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function TableCell({ className, ...props }) {
|
|
23
|
+
return (_jsx("td", { "data-slot": "table-cell", className: cn('px-5 py-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]', className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function TableCaption({ className, ...props }) {
|
|
26
|
+
return (_jsx("caption", { "data-slot": "table-caption", className: cn('text-muted-foreground mt-4 text-sm', className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const tabsTriggerPaddingVariants: (props?: ({
|
|
4
|
+
size?: "default" | "xs" | "sm" | "lg" | "md" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare const tabsTriggerHeightVariants: (props?: ({
|
|
7
|
+
size?: "default" | "xs" | "sm" | "lg" | "md" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
/** Shared tab typography for web and desktop. */
|
|
10
|
+
declare const tabsTriggerTextVariants: (props?: ({
|
|
11
|
+
size?: "default" | "xs" | "sm" | "lg" | "md" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
type TabsTriggerSize = 'xs' | 'sm' | 'default' | 'md';
|
|
14
|
+
type TabsSize = TabsTriggerSize | 'lg';
|
|
15
|
+
/**
|
|
16
|
+
* `default` is the filled pill; `outline` is a bordered active chip;
|
|
17
|
+
* `segmented` is the raised surface chip of a segmented control.
|
|
18
|
+
*/
|
|
19
|
+
type TabsTriggerVariant = 'default' | 'outline' | 'segmented';
|
|
20
|
+
/** Stroke thickness of the active underline rule (`type="underline"` only). */
|
|
21
|
+
type TabsUnderlineSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
22
|
+
/**
|
|
23
|
+
* `default` is the segmented control: a recessed track whose active tab is a
|
|
24
|
+
* raised surface chip. `segmented` is the same control, kept as an explicit
|
|
25
|
+
* name. `underline` is the flat rule. A vertical list (a settings rail) is
|
|
26
|
+
* never segmented.
|
|
27
|
+
*/
|
|
28
|
+
type TabsListType = 'default' | 'underline' | 'segmented';
|
|
29
|
+
declare function Tabs({ className, value, defaultValue, onValueChange, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
|
|
30
|
+
interface TabsListProps extends React.ComponentProps<typeof TabsPrimitive.List> {
|
|
31
|
+
type?: TabsListType;
|
|
32
|
+
/**
|
|
33
|
+
* `segmented` renders the segmented control (recessed track + raised chip):
|
|
34
|
+
* `<TabsList variant="segmented">`. Same as `type="segmented"`; `variant`
|
|
35
|
+
* wins when both are set.
|
|
36
|
+
*/
|
|
37
|
+
variant?: 'default' | 'segmented';
|
|
38
|
+
size?: TabsSize;
|
|
39
|
+
/** Active underline stroke. Only applies when `type="underline"`. Default `sm`. */
|
|
40
|
+
underlineSize?: TabsUnderlineSize;
|
|
41
|
+
animate?: 'fluid' | 'none';
|
|
42
|
+
/**
|
|
43
|
+
* `vertical` stacks triggers full-width in a column (e.g. a settings
|
|
44
|
+
* rail) instead of laying them out inline. This is a styling switch only —
|
|
45
|
+
* `aria-orientation` still comes from `orientation` on the `Tabs` root, per
|
|
46
|
+
* Radix. Default `horizontal`.
|
|
47
|
+
*/
|
|
48
|
+
orientation?: 'horizontal' | 'vertical';
|
|
49
|
+
}
|
|
50
|
+
declare function TabsList(props: TabsListProps): React.JSX.Element;
|
|
51
|
+
declare function TabsTrigger({ className, size: sizeProp, variant, value, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger> & {
|
|
52
|
+
size?: TabsTriggerSize;
|
|
53
|
+
variant?: TabsTriggerVariant;
|
|
54
|
+
}): React.JSX.Element;
|
|
55
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
|
|
56
|
+
/** Compact Radix TabsList — use inside <Tabs> root for smaller contexts. */
|
|
57
|
+
interface TabsListCompactProps extends React.ComponentProps<typeof TabsPrimitive.List> {
|
|
58
|
+
type?: Exclude<TabsListType, 'segmented'>;
|
|
59
|
+
/** Active underline stroke. Only applies when `type="underline"`. Default `sm`. */
|
|
60
|
+
underlineSize?: TabsUnderlineSize;
|
|
61
|
+
animate?: 'fluid' | 'none';
|
|
62
|
+
}
|
|
63
|
+
declare function TabsListCompact(props: TabsListCompactProps): React.JSX.Element;
|
|
64
|
+
/** Compact Radix TabsTrigger — use inside <Tabs> root for smaller contexts. */
|
|
65
|
+
declare function TabsTriggerCompact({ className, variant, value, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger> & {
|
|
66
|
+
variant?: Exclude<TabsTriggerVariant, 'segmented'>;
|
|
67
|
+
}): React.JSX.Element;
|
|
68
|
+
/** Standalone filter pill bar — works WITHOUT a <Tabs> root. Use for filter bars, mode toggles. */
|
|
69
|
+
declare function FilterBar({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
70
|
+
/** Standalone filter pill — works WITHOUT a <Tabs> root. Pair with FilterBar. */
|
|
71
|
+
declare function FilterBarItem({ className, ...props }: React.ComponentProps<'button'>): React.JSX.Element;
|
|
72
|
+
export { FilterBar, FilterBarItem, Tabs, TabsContent, TabsList, TabsListCompact, TabsTrigger, TabsTriggerCompact, tabsTriggerHeightVariants, tabsTriggerPaddingVariants, tabsTriggerTextVariants, };
|
|
73
|
+
export type { TabsListType, TabsSize, TabsTriggerSize, TabsTriggerVariant, TabsUnderlineSize };
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { SlidingTabIndicator } from './sliding-tab-indicator.js';
|
|
7
|
+
import { cn } from '../../lib/utils.js';
|
|
8
|
+
const tabsTriggerPaddingVariants = cva('', {
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
default: 'gap-2 px-4 py-2 has-[>svg]:px-3',
|
|
12
|
+
xs: 'gap-1.5 px-2.5 has-[>svg]:px-2',
|
|
13
|
+
sm: 'gap-1.5 px-3 has-[>svg]:px-2.5',
|
|
14
|
+
md: 'gap-2 px-5 has-[>svg]:px-4',
|
|
15
|
+
lg: 'gap-2 px-6 has-[>svg]:px-4',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: 'default',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
const tabsTriggerHeightVariants = cva('', {
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
default: 'h-8',
|
|
26
|
+
xs: 'h-7',
|
|
27
|
+
sm: 'h-8',
|
|
28
|
+
md: 'h-10',
|
|
29
|
+
lg: 'h-10',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
size: 'default',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
/** Shared tab typography for web and desktop. */
|
|
37
|
+
const tabsTriggerTextVariants = cva('font-medium', {
|
|
38
|
+
variants: {
|
|
39
|
+
size: {
|
|
40
|
+
default: 'text-sm',
|
|
41
|
+
xs: 'text-xs rounded-sm',
|
|
42
|
+
sm: 'text-xs',
|
|
43
|
+
md: 'text-sm',
|
|
44
|
+
lg: 'text-sm',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
size: 'default',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const tabsListHeightClasses = {
|
|
52
|
+
default: 'h-9',
|
|
53
|
+
xs: 'h-6',
|
|
54
|
+
sm: 'h-8',
|
|
55
|
+
md: 'h-10',
|
|
56
|
+
lg: 'h-10',
|
|
57
|
+
};
|
|
58
|
+
const tabsUnderlineBorderClasses = {
|
|
59
|
+
xs: '**:data-[slot=tabs-trigger]:after:h-px',
|
|
60
|
+
sm: '**:data-[slot=tabs-trigger]:after:h-[1.5px]',
|
|
61
|
+
md: '**:data-[slot=tabs-trigger]:after:h-0.5',
|
|
62
|
+
lg: '**:data-[slot=tabs-trigger]:after:h-[3px]',
|
|
63
|
+
};
|
|
64
|
+
/** Shared underline-list chrome; indicator height comes from `underlineSize`. */
|
|
65
|
+
const tabsListUnderlineBaseClasses = "border-border **:data-[slot=tabs-trigger]:data-[state=inactive]:text-muted-foreground text-muted-foreground **:data-[slot=tabs-trigger]:data-[state=active]:text-foreground inline-flex w-fit items-center justify-center gap-0 rounded-none border-b **:data-[slot=tabs-trigger]:relative **:data-[slot=tabs-trigger]:h-full **:data-[slot=tabs-trigger]:rounded-none **:data-[slot=tabs-trigger]:border-0 **:data-[slot=tabs-trigger]:bg-transparent **:data-[slot=tabs-trigger]:shadow-none **:data-[slot=tabs-trigger]:after:pointer-events-none **:data-[slot=tabs-trigger]:after:absolute **:data-[slot=tabs-trigger]:after:inset-x-0 **:data-[slot=tabs-trigger]:after:bottom-0 **:data-[slot=tabs-trigger]:after:rounded-full **:data-[slot=tabs-trigger]:after:bg-transparent **:data-[slot=tabs-trigger]:after:content-[''] **:data-[slot=tabs-trigger]:data-[state=active]:bg-transparent **:data-[slot=tabs-trigger]:data-[state=active]:shadow-none **:data-[slot=tabs-trigger]:data-[state=active]:after:bg-foreground **:data-[slot=tabs-trigger]:data-[state=inactive]:bg-transparent";
|
|
66
|
+
/**
|
|
67
|
+
* Segmented track + chip. Radii are concentric: the track is `rounded-md` (8px)
|
|
68
|
+
* with 2px of padding, so the chip is `rounded-sm` (6px). The chip lifts with a
|
|
69
|
+
* hairline ring plus `shadow-xs` — raised, not bordered, so it reads as the
|
|
70
|
+
* selected thing in both themes.
|
|
71
|
+
*
|
|
72
|
+
* The padding is `p-[2px]`, not `p-0.5`: `--spacing` is 0.23rem, so `p-0.5` is
|
|
73
|
+
* 1.84px. The chip's 1px ring leaves 0.84px of track showing, and a fraction of
|
|
74
|
+
* a pixel rounds differently on each side — 1px of track on one end and none on
|
|
75
|
+
* the other at 1x. A whole 2px leaves exactly 1px on every side.
|
|
76
|
+
*/
|
|
77
|
+
const tabsSegmentedTrackClasses = 'bg-muted rounded-md p-[2px]';
|
|
78
|
+
const tabsSegmentedChipClasses = 'bg-popover ring-border rounded-sm shadow-xs ring-1';
|
|
79
|
+
function resolveTabsTriggerSize(sizeProp, listSize) {
|
|
80
|
+
if (sizeProp)
|
|
81
|
+
return sizeProp;
|
|
82
|
+
if (listSize === 'xs')
|
|
83
|
+
return 'xs';
|
|
84
|
+
if (listSize === 'lg')
|
|
85
|
+
return 'md';
|
|
86
|
+
return listSize;
|
|
87
|
+
}
|
|
88
|
+
const TabsActiveValueContext = React.createContext('');
|
|
89
|
+
const TabsListTypeContext = React.createContext('default');
|
|
90
|
+
const TabsAnimateContext = React.createContext('none');
|
|
91
|
+
const TabsSizeContext = React.createContext('default');
|
|
92
|
+
/** Lets `TabsTrigger` adapt to a vertical `TabsList` without every caller re-passing orientation. */
|
|
93
|
+
const TabsOrientationContext = React.createContext('horizontal');
|
|
94
|
+
function Tabs({ className, value, defaultValue, onValueChange, ...props }) {
|
|
95
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue ?? '');
|
|
96
|
+
const activeValue = value !== undefined ? value : uncontrolledValue;
|
|
97
|
+
const handleValueChange = React.useCallback((next) => {
|
|
98
|
+
if (value === undefined) {
|
|
99
|
+
setUncontrolledValue(next);
|
|
100
|
+
}
|
|
101
|
+
onValueChange?.(next);
|
|
102
|
+
}, [onValueChange, value]);
|
|
103
|
+
return (_jsx(TabsActiveValueContext.Provider, { value: activeValue, children: _jsx(TabsPrimitive.Root, { "data-slot": "tabs", className: cn('flex flex-col gap-2', className), value: value, defaultValue: defaultValue, onValueChange: handleValueChange, ...props }) }));
|
|
104
|
+
}
|
|
105
|
+
function TabsList(props) {
|
|
106
|
+
return _jsx(TabsListRenderer, { ...props, orientation: props.orientation ?? 'horizontal' });
|
|
107
|
+
}
|
|
108
|
+
function TabsListRenderer({ className, type: typeProp = 'default', variant, size = 'default', underlineSize = 'sm', animate = 'none', orientation, compact = false, children, ...props }) {
|
|
109
|
+
const activeValue = React.useContext(TabsActiveValueContext);
|
|
110
|
+
const isVertical = !compact && orientation === 'vertical';
|
|
111
|
+
const requested = variant === 'segmented' ? 'segmented' : typeProp;
|
|
112
|
+
// Every horizontal list that is not `underline` is the segmented control.
|
|
113
|
+
// Triggers read the resolved type from context, so a vertical rail keeps its
|
|
114
|
+
// own row styling.
|
|
115
|
+
const type = requested === 'underline' ? 'underline' : isVertical ? 'default' : 'segmented';
|
|
116
|
+
const isSegmented = type === 'segmented';
|
|
117
|
+
const useSlidingIndicator = isSegmented && animate === 'fluid';
|
|
118
|
+
const trackClassName = cn(compact
|
|
119
|
+
? 'text-muted-foreground inline-flex h-7 w-fit items-center justify-center'
|
|
120
|
+
: 'text-muted-foreground inline-flex w-fit items-center justify-center', !compact && tabsListHeightClasses[size], tabsSegmentedTrackClasses, className);
|
|
121
|
+
const list = (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", className: cn(isSegmented && 'relative z-10 flex h-full w-full items-stretch justify-center gap-0.5', !isVertical && type === 'underline' && tabsListUnderlineBaseClasses, compact && type === 'underline' && 'h-7', !isVertical && type === 'underline' && tabsUnderlineBorderClasses[underlineSize], !compact && !isVertical && type === 'underline' && tabsListHeightClasses[size], isVertical && 'flex h-auto w-full flex-col items-stretch gap-0.5 rounded-none bg-transparent p-0', (!compact || type === 'underline') && className), ...props, children: children }));
|
|
122
|
+
// The sliding pill indicator only measures the x-axis (see
|
|
123
|
+
// SlidingTabIndicator) — in a column it would collapse to a
|
|
124
|
+
// zero-width bar, so vertical lists render without it.
|
|
125
|
+
const content = isVertical || type === 'underline' ? list : useSlidingIndicator ? (_jsx(SlidingTabIndicator, { activeId: activeValue, className: trackClassName, indicatorClassName: tabsSegmentedChipClasses, children: list })) : _jsx("div", { className: trackClassName, children: list });
|
|
126
|
+
return (_jsx(TabsListTypeContext.Provider, { value: type, children: _jsx(TabsAnimateContext.Provider, { value: animate, children: _jsx(TabsSizeContext.Provider, { value: size, children: compact ? content : (_jsx(TabsOrientationContext.Provider, { value: orientation ?? 'horizontal', children: content })) }) }) }));
|
|
127
|
+
}
|
|
128
|
+
function TabsTrigger({ className, size: sizeProp, variant = 'default', value, ...props }) {
|
|
129
|
+
const listType = React.useContext(TabsListTypeContext);
|
|
130
|
+
const animate = React.useContext(TabsAnimateContext);
|
|
131
|
+
const listSize = React.useContext(TabsSizeContext);
|
|
132
|
+
const listOrientation = React.useContext(TabsOrientationContext);
|
|
133
|
+
const size = resolveTabsTriggerSize(sizeProp, listSize);
|
|
134
|
+
const isUnderlineList = listType === 'underline';
|
|
135
|
+
// A segmented trigger either sits in a segmented list (the list's sliding
|
|
136
|
+
// chip paints the active state) or asks for it alone with
|
|
137
|
+
// `variant="segmented"` (it paints its own chip — there is no track to slide in).
|
|
138
|
+
const isSegmentedList = listType === 'segmented';
|
|
139
|
+
// An explicit `variant="outline"` keeps its bordered chip even in a segmented list.
|
|
140
|
+
const isOutline = !isUnderlineList && variant === 'outline';
|
|
141
|
+
const isSegmented = !isUnderlineList && !isOutline && (isSegmentedList || variant === 'segmented');
|
|
142
|
+
// Outline paints its own border; the sliding pill fill would fight it.
|
|
143
|
+
const useSlidingIndicator = !isUnderlineList &&
|
|
144
|
+
!isOutline &&
|
|
145
|
+
(!isSegmented || isSegmentedList) &&
|
|
146
|
+
animate === 'fluid';
|
|
147
|
+
const isVertical = listOrientation === 'vertical';
|
|
148
|
+
return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", "data-sliding-tab": useSlidingIndicator ? value : undefined, "data-variant": variant, value: value, className: cn("focus-visible:ring-kortix-blue duration-normal ease-default inline-flex flex-1 cursor-pointer items-center justify-center rounded-[calc(var(--radius)-2.5px)] border border-transparent whitespace-nowrap transition-[color,background-color,border-color,box-shadow] focus-visible:ring-[0.6px] focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", tabsTriggerTextVariants({ size }), tabsTriggerPaddingVariants({ size }), isUnderlineList || isSegmentedList ? 'h-full' : tabsTriggerHeightVariants({ size }),
|
|
149
|
+
// Segmented: the chip sits inside the track's padding, so the trigger
|
|
150
|
+
// fills the track and takes the chip's concentric radius.
|
|
151
|
+
isSegmented && 'rounded-sm',
|
|
152
|
+
// Without the sliding indicator the active trigger paints the chip itself.
|
|
153
|
+
isSegmented &&
|
|
154
|
+
!useSlidingIndicator &&
|
|
155
|
+
'data-[state=active]:bg-popover data-[state=active]:ring-border data-[state=active]:shadow-xs data-[state=active]:ring-1', isUnderlineList &&
|
|
156
|
+
'data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground rounded-none bg-transparent shadow-none data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=inactive]:bg-transparent',
|
|
157
|
+
// Default: a secondary-coloured pill. With animate="fluid" the sliding
|
|
158
|
+
// indicator paints the pill behind the trigger, so the trigger itself
|
|
159
|
+
// stays transparent; otherwise the trigger paints its own.
|
|
160
|
+
!isUnderlineList &&
|
|
161
|
+
!isOutline &&
|
|
162
|
+
'data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground relative z-10 data-[state=inactive]:bg-transparent', !isUnderlineList &&
|
|
163
|
+
!isOutline &&
|
|
164
|
+
!isSegmented &&
|
|
165
|
+
(useSlidingIndicator
|
|
166
|
+
? 'data-[state=active]:bg-transparent'
|
|
167
|
+
: 'data-[state=active]:bg-input'), isSegmented && useSlidingIndicator && 'data-[state=active]:bg-transparent',
|
|
168
|
+
// Outline: bordered active chip — matches Button `outline` (border + transparent fill).
|
|
169
|
+
isOutline &&
|
|
170
|
+
'data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:bg-foreground/5 hover:data-[state=inactive]:text-foreground data-[state=active]:border-border relative z-10 bg-transparent data-[state=active]:bg-transparent data-[state=inactive]:bg-transparent', isVertical && 'w-full justify-start text-left', className), ...props }));
|
|
171
|
+
}
|
|
172
|
+
function TabsContent({ className, ...props }) {
|
|
173
|
+
return (_jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn('flex-1 outline-none', className), ...props }));
|
|
174
|
+
}
|
|
175
|
+
function TabsListCompact(props) {
|
|
176
|
+
// Same rule as `TabsList`: anything that is not `underline` is segmented.
|
|
177
|
+
return _jsx(TabsListRenderer, { ...props, size: "xs", compact: true });
|
|
178
|
+
}
|
|
179
|
+
/** Compact Radix TabsTrigger — use inside <Tabs> root for smaller contexts. */
|
|
180
|
+
function TabsTriggerCompact({ className, variant = 'default', value, ...props }) {
|
|
181
|
+
const listType = React.useContext(TabsListTypeContext);
|
|
182
|
+
const animate = React.useContext(TabsAnimateContext);
|
|
183
|
+
const isUnderlineList = listType === 'underline';
|
|
184
|
+
const isOutline = !isUnderlineList && variant === 'outline';
|
|
185
|
+
const isSegmented = !isUnderlineList && !isOutline;
|
|
186
|
+
const useSlidingIndicator = isSegmented && animate === 'fluid';
|
|
187
|
+
return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", "data-sliding-tab": useSlidingIndicator ? value : undefined, "data-variant": variant, value: value, className: cn('focus-visible:ring-kortix-blue relative z-10 inline-flex flex-1 cursor-pointer items-center justify-center border border-transparent text-xs font-medium whitespace-nowrap focus-visible:ring-[0.6px] focus-visible:outline-none', tabsTriggerPaddingVariants({ size: 'xs' }), isUnderlineList || isSegmented
|
|
188
|
+
? 'h-full'
|
|
189
|
+
: tabsTriggerHeightVariants({ size: 'xs' }), isUnderlineList && 'rounded-none', isUnderlineList &&
|
|
190
|
+
'duration-normal ease-default data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground rounded-none bg-transparent shadow-none transition-[color,background-color,border-color,box-shadow] data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=inactive]:bg-transparent motion-reduce:transition-none',
|
|
191
|
+
// Segmented (the default) — see TabsTrigger: the sliding chip paints the
|
|
192
|
+
// active state, or the trigger paints it when there is no slide.
|
|
193
|
+
isSegmented &&
|
|
194
|
+
'data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground rounded-sm bg-transparent transition-colors duration-150', isSegmented &&
|
|
195
|
+
!useSlidingIndicator &&
|
|
196
|
+
'data-[state=active]:bg-popover data-[state=active]:ring-border data-[state=active]:shadow-xs data-[state=active]:ring-1', isOutline &&
|
|
197
|
+
'data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:bg-foreground/5 hover:data-[state=inactive]:text-foreground data-[state=active]:border-border rounded-[calc(var(--radius)-3px)] bg-transparent transition-[color,background-color,border-color] duration-150 data-[state=active]:bg-transparent data-[state=inactive]:bg-transparent', 'disabled:pointer-events-none disabled:opacity-50', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5", className), ...props }));
|
|
198
|
+
}
|
|
199
|
+
/** Standalone filter pill bar — works WITHOUT a <Tabs> root. Use for filter bars, mode toggles. */
|
|
200
|
+
function FilterBar({ className, ...props }) {
|
|
201
|
+
return (_jsx("div", { "data-slot": "filter-bar", role: "tablist", className: cn('bg-foreground/5 text-muted-foreground inline-flex h-9 w-fit items-center justify-center gap-0.5 p-0.5', className), ...props }));
|
|
202
|
+
}
|
|
203
|
+
/** Standalone filter pill — works WITHOUT a <Tabs> root. Pair with FilterBar. */
|
|
204
|
+
function FilterBarItem({ className, ...props }) {
|
|
205
|
+
return (_jsx("button", { "data-slot": "filter-bar-item", role: "tab", type: "button", className: cn('inline-flex h-[calc(100%-4px)] flex-1 cursor-pointer items-center justify-center gap-1.5 border border-transparent px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-colors duration-150', 'text-muted-foreground/60 hover:text-foreground/80', 'data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:ring-foreground/6 data-[state=active]:shadow-sm data-[state=active]:ring-1', 'disabled:pointer-events-none disabled:opacity-50', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5", className), ...props }));
|
|
206
|
+
}
|
|
207
|
+
export { FilterBar, FilterBarItem, Tabs, TabsContent, TabsList, TabsListCompact, TabsTrigger, TabsTriggerCompact, tabsTriggerHeightVariants, tabsTriggerPaddingVariants, tabsTriggerTextVariants, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const tagVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "warning" | "new" | "custom" | "free" | "latest" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Tag({ className, variant, ...props }: React.ComponentProps<'span'> & VariantProps<typeof tagVariants>): React.JSX.Element;
|
|
7
|
+
export { Tag, tagVariants };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../../lib/utils.js';
|
|
4
|
+
const tagVariants = cva('px-1.5 py-0.5 rounded text-xs font-medium leading-none shrink-0 inline-flex items-center', {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: 'bg-muted text-muted-foreground',
|
|
8
|
+
free: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400',
|
|
9
|
+
latest: 'bg-blue-500/10 text-blue-600 dark:text-blue-400',
|
|
10
|
+
custom: 'bg-muted text-muted-foreground',
|
|
11
|
+
new: 'bg-primary/10 text-primary',
|
|
12
|
+
warning: 'bg-amber-500/10 text-amber-600 dark:text-amber-400',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: 'default',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
function Tag({ className, variant, ...props }) {
|
|
20
|
+
return _jsx("span", { "data-slot": "tag", className: cn(tagVariants({ variant }), className), ...props });
|
|
21
|
+
}
|
|
22
|
+
export { Tag, tagVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TextShimmerProps = {
|
|
3
|
+
children: string;
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
className?: string;
|
|
6
|
+
duration?: number;
|
|
7
|
+
spread?: number;
|
|
8
|
+
/** Number of times to play. Defaults to Infinity (loop forever). Use 1 for a single sweep. */
|
|
9
|
+
repeat?: number;
|
|
10
|
+
};
|
|
11
|
+
declare function TextShimmerComponent({ children, as: Component, className, duration, spread, repeat, }: TextShimmerProps): React.JSX.Element;
|
|
12
|
+
export declare const TextShimmer: React.MemoExoticComponent<typeof TextShimmerComponent>;
|
|
13
|
+
export {};
|