@luxfi/ui 7.4.15 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/dist/3d-button.cjs +298 -0
- package/dist/3d-button.d.ts +52 -0
- package/dist/3d-button.d.ts.map +1 -0
- package/dist/3d-button.js +273 -0
- package/dist/3d-card.cjs +236 -0
- package/dist/3d-card.d.ts +29 -0
- package/dist/3d-card.d.ts.map +1 -0
- package/dist/3d-card.js +209 -0
- package/dist/3d-carousel.cjs +375 -0
- package/dist/3d-carousel.d.ts +26 -0
- package/dist/3d-carousel.d.ts.map +1 -0
- package/dist/3d-carousel.js +348 -0
- package/dist/3d-grid.cjs +360 -0
- package/dist/3d-grid.d.ts +49 -0
- package/dist/3d-grid.d.ts.map +1 -0
- package/dist/3d-grid.js +335 -0
- package/dist/3d-marquee.cjs +8669 -0
- package/dist/3d-marquee.d.ts +65 -0
- package/dist/3d-marquee.d.ts.map +1 -0
- package/dist/3d-marquee.js +8645 -0
- package/dist/3d-model-viewer.cjs +909 -0
- package/dist/3d-model-viewer.d.ts +45 -0
- package/dist/3d-model-viewer.d.ts.map +1 -0
- package/dist/3d-model-viewer.js +886 -0
- package/dist/3d-pin.cjs +46 -0
- package/dist/3d-pin.d.ts +8 -0
- package/dist/3d-pin.d.ts.map +1 -0
- package/dist/3d-pin.js +24 -0
- package/dist/3d-scene.cjs +439 -0
- package/dist/3d-scene.d.ts +76 -0
- package/dist/3d-scene.d.ts.map +1 -0
- package/dist/3d-scene.js +407 -0
- package/dist/3d-text.cjs +367 -0
- package/dist/3d-text.d.ts +62 -0
- package/dist/3d-text.d.ts.map +1 -0
- package/dist/3d-text.js +341 -0
- package/dist/accordion.d.ts +10 -12
- package/dist/accordion.d.ts.map +1 -0
- package/dist/advanced-chart.cjs +53 -0
- package/dist/advanced-chart.d.ts +6 -0
- package/dist/advanced-chart.d.ts.map +1 -0
- package/dist/advanced-chart.js +51 -0
- package/dist/advanced-navigation-bar.cjs +459 -0
- package/dist/advanced-navigation-bar.d.ts +14 -0
- package/dist/advanced-navigation-bar.d.ts.map +1 -0
- package/dist/advanced-navigation-bar.js +437 -0
- package/dist/ai-actions.cjs +57 -0
- package/dist/ai-actions.d.ts +14 -0
- package/dist/ai-actions.d.ts.map +1 -0
- package/dist/ai-actions.js +35 -0
- package/dist/ai-agents.cjs +1764 -0
- package/dist/ai-agents.d.ts +56 -0
- package/dist/ai-agents.d.ts.map +1 -0
- package/dist/ai-agents.js +1740 -0
- package/dist/ai-assistant.cjs +907 -0
- package/dist/ai-assistant.d.ts +28 -0
- package/dist/ai-assistant.d.ts.map +1 -0
- package/dist/ai-assistant.js +886 -0
- package/dist/ai-chat.cjs +1165 -0
- package/dist/ai-chat.d.ts +56 -0
- package/dist/ai-chat.d.ts.map +1 -0
- package/dist/ai-chat.js +1141 -0
- package/dist/ai-code.cjs +1866 -0
- package/dist/ai-code.d.ts +58 -0
- package/dist/ai-code.d.ts.map +1 -0
- package/dist/ai-code.js +1841 -0
- package/dist/ai-model-selector-navigation-bar.cjs +59 -0
- package/dist/ai-model-selector-navigation-bar.d.ts +15 -0
- package/dist/ai-model-selector-navigation-bar.d.ts.map +1 -0
- package/dist/ai-model-selector-navigation-bar.js +37 -0
- package/dist/ai-models.cjs +41 -0
- package/dist/ai-models.d.ts +15 -0
- package/dist/ai-models.d.ts.map +1 -0
- package/dist/ai-models.js +19 -0
- package/dist/ai-playground.cjs +1110 -0
- package/dist/ai-playground.d.ts +66 -0
- package/dist/ai-playground.d.ts.map +1 -0
- package/dist/ai-playground.js +1088 -0
- package/dist/ai-tools.cjs +1043 -0
- package/dist/ai-tools.d.ts +23 -0
- package/dist/ai-tools.d.ts.map +1 -0
- package/dist/ai-tools.js +1022 -0
- package/dist/ai-vision.cjs +1831 -0
- package/dist/ai-vision.d.ts +74 -0
- package/dist/ai-vision.d.ts.map +1 -0
- package/dist/ai-vision.js +1810 -0
- package/dist/ai-voice-settings.cjs +1511 -0
- package/dist/ai-voice-settings.d.ts +100 -0
- package/dist/ai-voice-settings.d.ts.map +1 -0
- package/dist/ai-voice-settings.js +1478 -0
- package/dist/ai-voice.cjs +1522 -0
- package/dist/ai-voice.d.ts +72 -0
- package/dist/ai-voice.d.ts.map +1 -0
- package/dist/ai-voice.js +1501 -0
- package/dist/alert.cjs +14 -147
- package/dist/alert.d.ts +4 -5
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +14 -147
- package/dist/android.cjs +127 -0
- package/dist/android.d.ts +19 -0
- package/dist/android.d.ts.map +1 -0
- package/dist/android.js +104 -0
- package/dist/animated-background.cjs +8830 -0
- package/dist/animated-background.d.ts +103 -0
- package/dist/animated-background.d.ts.map +1 -0
- package/dist/animated-background.js +8824 -0
- package/dist/animated-beam.cjs +8438 -0
- package/dist/animated-beam.d.ts +15 -0
- package/dist/animated-beam.d.ts.map +1 -0
- package/dist/animated-beam.js +8417 -0
- package/dist/animated-cursor.cjs +269 -0
- package/dist/animated-cursor.d.ts +70 -0
- package/dist/animated-cursor.d.ts.map +1 -0
- package/dist/animated-cursor.js +264 -0
- package/dist/animated-icon.cjs +8927 -0
- package/dist/animated-icon.d.ts +119 -0
- package/dist/animated-icon.d.ts.map +1 -0
- package/dist/animated-icon.js +8902 -0
- package/dist/animated-list.cjs +9226 -0
- package/dist/animated-list.d.ts +126 -0
- package/dist/animated-list.d.ts.map +1 -0
- package/dist/animated-list.js +9201 -0
- package/dist/animated-number.cjs +8773 -0
- package/dist/animated-number.d.ts +127 -0
- package/dist/animated-number.d.ts.map +1 -0
- package/dist/animated-number.js +8767 -0
- package/dist/animated-testimonials.cjs +8653 -0
- package/dist/animated-testimonials.d.ts +17 -0
- package/dist/animated-testimonials.d.ts.map +1 -0
- package/dist/animated-testimonials.js +8632 -0
- package/dist/animated-text.cjs +8914 -0
- package/dist/animated-text.d.ts +65 -0
- package/dist/animated-text.d.ts.map +1 -0
- package/dist/animated-text.js +8890 -0
- package/dist/animated-tooltip.cjs +8624 -0
- package/dist/animated-tooltip.d.ts +9 -0
- package/dist/animated-tooltip.d.ts.map +1 -0
- package/dist/animated-tooltip.js +8603 -0
- package/dist/announcement.cjs +465 -0
- package/dist/announcement.d.ts +9 -0
- package/dist/announcement.d.ts.map +1 -0
- package/dist/announcement.js +443 -0
- package/dist/app-switcher-navigation-bar.cjs +470 -0
- package/dist/app-switcher-navigation-bar.d.ts +15 -0
- package/dist/app-switcher-navigation-bar.d.ts.map +1 -0
- package/dist/app-switcher-navigation-bar.js +448 -0
- package/dist/apple-cards-carousel.cjs +9356 -0
- package/dist/apple-cards-carousel.d.ts +36 -0
- package/dist/apple-cards-carousel.d.ts.map +1 -0
- package/dist/apple-cards-carousel.js +9334 -0
- package/dist/apple-hello-effect.cjs +8380 -0
- package/dist/apple-hello-effect.d.ts +8 -0
- package/dist/apple-hello-effect.d.ts.map +1 -0
- package/dist/apple-hello-effect.js +8359 -0
- package/dist/auth.cjs +6 -5
- package/dist/auth.d.ts +11 -13
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +6 -5
- package/dist/avatar.d.ts +5 -6
- package/dist/avatar.d.ts.map +1 -0
- package/dist/badge.cjs +29 -169
- package/dist/badge.d.ts +9 -13
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +29 -169
- package/dist/bank.d.ts +42 -47
- package/dist/bank.d.ts.map +1 -0
- package/dist/banner.cjs +78 -0
- package/dist/banner.d.ts +20 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +55 -0
- package/dist/breadcrumb-and-filters-navigation-bar.cjs +51 -0
- package/dist/breadcrumb-and-filters-navigation-bar.d.ts +10 -0
- package/dist/breadcrumb-and-filters-navigation-bar.d.ts.map +1 -0
- package/dist/breadcrumb-and-filters-navigation-bar.js +29 -0
- package/dist/breadcrumb-navigation-bar.cjs +37 -0
- package/dist/breadcrumb-navigation-bar.d.ts +10 -0
- package/dist/breadcrumb-navigation-bar.d.ts.map +1 -0
- package/dist/breadcrumb-navigation-bar.js +15 -0
- package/dist/button.cjs +21 -154
- package/dist/button.d.ts +9 -10
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +21 -154
- package/dist/calendar.cjs +55 -0
- package/dist/calendar.d.ts +9 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +53 -0
- package/dist/centered-logo-navigation-bar.cjs +37 -0
- package/dist/centered-logo-navigation-bar.d.ts +15 -0
- package/dist/centered-logo-navigation-bar.d.ts.map +1 -0
- package/dist/centered-logo-navigation-bar.js +15 -0
- package/dist/chart.cjs +266 -0
- package/dist/chart.d.ts +52 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +238 -0
- package/dist/checkbox.d.ts +6 -7
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/choicebox.cjs +77 -0
- package/dist/choicebox.d.ts +15 -0
- package/dist/choicebox.d.ts.map +1 -0
- package/dist/choicebox.js +55 -0
- package/dist/chrome.cjs +39 -37
- package/dist/chrome.d.ts +15 -19
- package/dist/chrome.d.ts.map +1 -0
- package/dist/chrome.js +37 -35
- package/dist/close-button.d.ts +3 -5
- package/dist/close-button.d.ts.map +1 -0
- package/dist/code-block.cjs +871 -0
- package/dist/code-block.d.ts +38 -0
- package/dist/code-block.d.ts.map +1 -0
- package/dist/code-block.js +849 -0
- package/dist/code-compare.cjs +1714 -0
- package/dist/code-compare.d.ts +46 -0
- package/dist/code-compare.d.ts.map +1 -0
- package/dist/code-compare.js +1692 -0
- package/dist/code-diff.cjs +1073 -0
- package/dist/code-diff.d.ts +42 -0
- package/dist/code-diff.d.ts.map +1 -0
- package/dist/code-diff.js +1051 -0
- package/dist/code-editor.cjs +641 -0
- package/dist/code-editor.d.ts +23 -0
- package/dist/code-editor.d.ts.map +1 -0
- package/dist/code-editor.js +616 -0
- package/dist/code-explorer.cjs +729 -0
- package/dist/code-explorer.d.ts +41 -0
- package/dist/code-explorer.d.ts.map +1 -0
- package/dist/code-explorer.js +707 -0
- package/dist/code-preview.cjs +1349 -0
- package/dist/code-preview.d.ts +38 -0
- package/dist/code-preview.d.ts.map +1 -0
- package/dist/code-preview.js +1327 -0
- package/dist/code-snippet.cjs +920 -0
- package/dist/code-snippet.d.ts +48 -0
- package/dist/code-snippet.d.ts.map +1 -0
- package/dist/code-snippet.js +897 -0
- package/dist/code-tabs.cjs +76 -0
- package/dist/code-tabs.d.ts +12 -0
- package/dist/code-tabs.d.ts.map +1 -0
- package/dist/code-tabs.js +54 -0
- package/dist/code-terminal.cjs +894 -0
- package/dist/code-terminal.d.ts +48 -0
- package/dist/code-terminal.d.ts.map +1 -0
- package/dist/code-terminal.js +872 -0
- package/dist/collaboration-navigation-bar.cjs +49 -0
- package/dist/collaboration-navigation-bar.d.ts +11 -0
- package/dist/collaboration-navigation-bar.d.ts.map +1 -0
- package/dist/collaboration-navigation-bar.js +27 -0
- package/dist/collapsible.cjs +45 -170
- package/dist/collapsible.d.ts +11 -13
- package/dist/collapsible.d.ts.map +1 -0
- package/dist/collapsible.js +34 -159
- package/dist/color-mode.d.ts +7 -9
- package/dist/color-mode.d.ts.map +1 -0
- package/dist/color-picker.cjs +516 -0
- package/dist/color-picker.d.ts +10 -0
- package/dist/color-picker.d.ts.map +1 -0
- package/dist/color-picker.js +495 -0
- package/dist/combobox.cjs +488 -0
- package/dist/combobox.d.ts +13 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +466 -0
- package/dist/communication-navigation-bar.cjs +438 -0
- package/dist/communication-navigation-bar.d.ts +7 -0
- package/dist/communication-navigation-bar.d.ts.map +1 -0
- package/dist/communication-navigation-bar.js +416 -0
- package/dist/company-profile.cjs +46 -0
- package/dist/company-profile.d.ts +10 -0
- package/dist/company-profile.d.ts.map +1 -0
- package/dist/company-profile.js +44 -0
- package/dist/comparison.cjs +60 -0
- package/dist/comparison.d.ts +16 -0
- package/dist/comparison.d.ts.map +1 -0
- package/dist/comparison.js +38 -0
- package/dist/context-switcher-navigation-bar.cjs +51 -0
- package/dist/context-switcher-navigation-bar.d.ts +10 -0
- package/dist/context-switcher-navigation-bar.d.ts.map +1 -0
- package/dist/context-switcher-navigation-bar.js +29 -0
- package/dist/credit-card.cjs +77 -0
- package/dist/credit-card.d.ts +11 -0
- package/dist/credit-card.d.ts.map +1 -0
- package/dist/credit-card.js +55 -0
- package/dist/crypto-screener.cjs +43 -0
- package/dist/crypto-screener.d.ts +4 -0
- package/dist/crypto-screener.d.ts.map +1 -0
- package/dist/crypto-screener.js +41 -0
- package/dist/cursor.cjs +71 -0
- package/dist/cursor.d.ts +9 -0
- package/dist/cursor.d.ts.map +1 -0
- package/dist/cursor.js +49 -0
- package/dist/dashboard-navigation-bar.cjs +441 -0
- package/dist/dashboard-navigation-bar.d.ts +11 -0
- package/dist/dashboard-navigation-bar.d.ts.map +1 -0
- package/dist/dashboard-navigation-bar.js +419 -0
- package/dist/dialog-stack.cjs +460 -0
- package/dist/dialog-stack.d.ts +13 -0
- package/dist/dialog-stack.d.ts.map +1 -0
- package/dist/dialog-stack.js +438 -0
- package/dist/dialog.cjs +16 -19
- package/dist/dialog.d.ts +49 -53
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +12 -15
- package/dist/direction.cjs +26 -0
- package/dist/direction.d.ts +20 -0
- package/dist/direction.d.ts.map +1 -0
- package/dist/direction.js +23 -0
- package/dist/dock.cjs +8675 -0
- package/dist/dock.d.ts +20 -0
- package/dist/dock.d.ts.map +1 -0
- package/dist/dock.js +8653 -0
- package/dist/drawer.d.ts +33 -38
- package/dist/drawer.d.ts.map +1 -0
- package/dist/dropzone.cjs +116 -0
- package/dist/dropzone.d.ts +11 -0
- package/dist/dropzone.d.ts.map +1 -0
- package/dist/dropzone.js +94 -0
- package/dist/e-commerce-navigation-bar.cjs +442 -0
- package/dist/e-commerce-navigation-bar.d.ts +12 -0
- package/dist/e-commerce-navigation-bar.d.ts.map +1 -0
- package/dist/e-commerce-navigation-bar.js +420 -0
- package/dist/editor.cjs +497 -0
- package/dist/editor.d.ts +9 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +475 -0
- package/dist/empty-state.d.ts +4 -6
- package/dist/empty-state.d.ts.map +1 -0
- package/dist/empty.cjs +117 -0
- package/dist/empty.d.ts +18 -0
- package/dist/empty.d.ts.map +1 -0
- package/dist/empty.js +110 -0
- package/dist/engine.cjs +91 -0
- package/dist/engine.d.ts +35 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +86 -0
- package/dist/expiration-selector.d.ts +4 -6
- package/dist/expiration-selector.d.ts.map +1 -0
- package/dist/field.cjs +2 -1
- package/dist/field.d.ts +5 -7
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +3 -2
- package/dist/financials.cjs +66 -0
- package/dist/financials.d.ts +12 -0
- package/dist/financials.d.ts.map +1 -0
- package/dist/financials.js +64 -0
- package/dist/forex-screener.cjs +44 -0
- package/dist/forex-screener.d.ts +4 -0
- package/dist/forex-screener.d.ts.map +1 -0
- package/dist/forex-screener.js +42 -0
- package/dist/gantt.cjs +65 -0
- package/dist/gantt.d.ts +13 -0
- package/dist/gantt.d.ts.map +1 -0
- package/dist/gantt.js +43 -0
- package/dist/greeks-display.d.ts +3 -5
- package/dist/greeks-display.d.ts.map +1 -0
- package/dist/grid-pattern.cjs +327 -0
- package/dist/grid-pattern.d.ts +111 -0
- package/dist/grid-pattern.d.ts.map +1 -0
- package/dist/grid-pattern.js +304 -0
- package/dist/gui.d.ts +1 -1
- package/dist/gui.d.ts.map +1 -0
- package/dist/heading.d.ts +4 -6
- package/dist/heading.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/iam.d.ts +10 -12
- package/dist/iam.d.ts.map +1 -0
- package/dist/icon-button.cjs +14 -147
- package/dist/icon-button.d.ts +4 -5
- package/dist/icon-button.d.ts.map +1 -0
- package/dist/icon-button.js +14 -147
- package/dist/icon-navigation-bar.cjs +48 -0
- package/dist/icon-navigation-bar.d.ts +11 -0
- package/dist/icon-navigation-bar.d.ts.map +1 -0
- package/dist/icon-navigation-bar.js +26 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/identity.d.ts +9 -11
- package/dist/identity.d.ts.map +1 -0
- package/dist/image-crop.cjs +482 -0
- package/dist/image-crop.d.ts +9 -0
- package/dist/image-crop.d.ts.map +1 -0
- package/dist/image-crop.js +460 -0
- package/dist/image-zoom.cjs +77 -0
- package/dist/image-zoom.d.ts +7 -0
- package/dist/image-zoom.d.ts.map +1 -0
- package/dist/image-zoom.js +55 -0
- package/dist/image.cjs +17 -149
- package/dist/image.d.ts +10 -11
- package/dist/image.d.ts.map +1 -0
- package/dist/image.js +16 -148
- package/dist/index.cjs +30299 -1227
- package/dist/index.d.ts +207 -60
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30009 -1226
- package/dist/ink.cjs +17 -0
- package/dist/ink.d.ts +14 -0
- package/dist/ink.d.ts.map +1 -0
- package/dist/ink.js +15 -0
- package/dist/input-group.d.ts +4 -6
- package/dist/input-group.d.ts.map +1 -0
- package/dist/input-otp.cjs +72 -0
- package/dist/input-otp.d.ts +35 -0
- package/dist/input-otp.d.ts.map +1 -0
- package/dist/input-otp.js +47 -0
- package/dist/input.d.ts +8 -9
- package/dist/input.d.ts.map +1 -0
- package/dist/iphone-15-pro.cjs +61 -0
- package/dist/iphone-15-pro.d.ts +9 -0
- package/dist/iphone-15-pro.d.ts.map +1 -0
- package/dist/iphone-15-pro.js +39 -0
- package/dist/item.cjs +215 -0
- package/dist/item.d.ts +41 -0
- package/dist/item.d.ts.map +1 -0
- package/dist/item.js +200 -0
- package/dist/kanban.cjs +1354 -0
- package/dist/kanban.d.ts +36 -0
- package/dist/kanban.d.ts.map +1 -0
- package/dist/kanban.js +1330 -0
- package/dist/kbd.cjs +40 -0
- package/dist/kbd.d.ts +4 -0
- package/dist/kbd.d.ts.map +1 -0
- package/dist/kbd.js +37 -0
- package/dist/limelight-nav-navigation-bar.cjs +51 -0
- package/dist/limelight-nav-navigation-bar.d.ts +10 -0
- package/dist/limelight-nav-navigation-bar.d.ts.map +1 -0
- package/dist/limelight-nav-navigation-bar.js +29 -0
- package/dist/limelight-nav.cjs +570 -0
- package/dist/limelight-nav.d.ts +10 -0
- package/dist/limelight-nav.d.ts.map +1 -0
- package/dist/limelight-nav.js +549 -0
- package/dist/link.cjs +41 -168
- package/dist/link.d.ts +9 -11
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +30 -157
- package/dist/list.cjs +35 -0
- package/dist/list.d.ts +5 -0
- package/dist/list.d.ts.map +1 -0
- package/dist/list.js +12 -0
- package/dist/lux.config.d.ts +521 -524
- package/dist/lux.config.d.ts.map +1 -0
- package/dist/magnetic.cjs +63 -0
- package/dist/magnetic.d.ts +8 -0
- package/dist/magnetic.d.ts.map +1 -0
- package/dist/magnetic.js +41 -0
- package/dist/market-overview.cjs +102 -0
- package/dist/market-overview.d.ts +4 -0
- package/dist/market-overview.d.ts.map +1 -0
- package/dist/market-overview.js +100 -0
- package/dist/marquee.cjs +67 -0
- package/dist/marquee.d.ts +10 -0
- package/dist/marquee.d.ts.map +1 -0
- package/dist/marquee.js +45 -0
- package/dist/menu-dock.cjs +64 -0
- package/dist/menu-dock.d.ts +14 -0
- package/dist/menu-dock.d.ts.map +1 -0
- package/dist/menu-dock.js +42 -0
- package/dist/menu.d.ts +30 -31
- package/dist/menu.d.ts.map +1 -0
- package/dist/menubar.cjs +116 -0
- package/dist/menubar.d.ts +30 -0
- package/dist/menubar.d.ts.map +1 -0
- package/dist/menubar.js +61 -0
- package/dist/message-dock.cjs +480 -0
- package/dist/message-dock.d.ts +15 -0
- package/dist/message-dock.d.ts.map +1 -0
- package/dist/message-dock.js +458 -0
- package/dist/mini-calendar.cjs +505 -0
- package/dist/mini-calendar.d.ts +10 -0
- package/dist/mini-calendar.d.ts.map +1 -0
- package/dist/mini-calendar.js +483 -0
- package/dist/minimal-tiptap.cjs +48 -0
- package/dist/minimal-tiptap.d.ts +8 -0
- package/dist/minimal-tiptap.d.ts.map +1 -0
- package/dist/minimal-tiptap.js +26 -0
- package/dist/motion-highlight.cjs +71 -0
- package/dist/motion-highlight.d.ts +7 -0
- package/dist/motion-highlight.d.ts.map +1 -0
- package/dist/motion-highlight.js +49 -0
- package/dist/music-player.cjs +810 -0
- package/dist/music-player.d.ts +18 -0
- package/dist/music-player.d.ts.map +1 -0
- package/dist/music-player.js +788 -0
- package/dist/native-select.cjs +82 -0
- package/dist/native-select.d.ts +9 -0
- package/dist/native-select.d.ts.map +1 -0
- package/dist/native-select.js +58 -0
- package/dist/news-timeline.cjs +42 -0
- package/dist/news-timeline.d.ts +4 -0
- package/dist/news-timeline.d.ts.map +1 -0
- package/dist/news-timeline.js +40 -0
- package/dist/next.d.ts +5 -7
- package/dist/next.d.ts.map +1 -0
- package/dist/option-chain.d.ts +6 -8
- package/dist/option-chain.d.ts.map +1 -0
- package/dist/option-position.d.ts +4 -6
- package/dist/option-position.d.ts.map +1 -0
- package/dist/order-entry.cjs +141 -0
- package/dist/order-entry.d.ts +15 -0
- package/dist/order-entry.d.ts.map +1 -0
- package/dist/order-entry.js +136 -0
- package/dist/orders-history.cjs +83 -0
- package/dist/orders-history.d.ts +18 -0
- package/dist/orders-history.d.ts.map +1 -0
- package/dist/orders-history.js +78 -0
- package/dist/pagination.cjs +132 -0
- package/dist/pagination.d.ts +29 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +104 -0
- package/dist/particles-background.cjs +159 -0
- package/dist/particles-background.d.ts +18 -0
- package/dist/particles-background.d.ts.map +1 -0
- package/dist/particles-background.js +157 -0
- package/dist/pill.cjs +80 -0
- package/dist/pill.d.ts +21 -0
- package/dist/pill.d.ts.map +1 -0
- package/dist/pill.js +57 -0
- package/dist/pin-input.cjs +1 -1
- package/dist/pin-input.d.ts +3 -5
- package/dist/pin-input.d.ts.map +1 -0
- package/dist/pin-input.js +1 -1
- package/dist/pixel-image.cjs +71 -0
- package/dist/pixel-image.d.ts +8 -0
- package/dist/pixel-image.d.ts.map +1 -0
- package/dist/pixel-image.js +49 -0
- package/dist/pnl-diagram.d.ts +5 -6
- package/dist/pnl-diagram.d.ts.map +1 -0
- package/dist/popover.cjs +16 -18
- package/dist/popover.d.ts +24 -25
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +11 -13
- package/dist/positions-list.cjs +98 -0
- package/dist/positions-list.d.ts +13 -0
- package/dist/positions-list.d.ts.map +1 -0
- package/dist/positions-list.js +93 -0
- package/dist/progress-circle.cjs +3 -6
- package/dist/progress-circle.d.ts +8 -9
- package/dist/progress-circle.d.ts.map +1 -0
- package/dist/progress-circle.js +2 -5
- package/dist/progress.d.ts +3 -4
- package/dist/progress.d.ts.map +1 -0
- package/dist/provider.d.ts +8 -10
- package/dist/provider.d.ts.map +1 -0
- package/dist/pulse-animation.cjs +8741 -0
- package/dist/pulse-animation.d.ts +155 -0
- package/dist/pulse-animation.d.ts.map +1 -0
- package/dist/pulse-animation.js +8732 -0
- package/dist/qr-code.cjs +65 -0
- package/dist/qr-code.d.ts +21 -0
- package/dist/qr-code.d.ts.map +1 -0
- package/dist/qr-code.js +43 -0
- package/dist/radio.d.ts +6 -7
- package/dist/radio.d.ts.map +1 -0
- package/dist/rating.d.ts +3 -5
- package/dist/rating.d.ts.map +1 -0
- package/dist/relative-time.cjs +88 -0
- package/dist/relative-time.d.ts +9 -0
- package/dist/relative-time.d.ts.map +1 -0
- package/dist/relative-time.js +66 -0
- package/dist/resizable.cjs +61 -0
- package/dist/resizable.d.ts +24 -0
- package/dist/resizable.d.ts.map +1 -0
- package/dist/resizable.js +37 -0
- package/dist/reveal-animation.cjs +8791 -0
- package/dist/reveal-animation.d.ts +134 -0
- package/dist/reveal-animation.d.ts.map +1 -0
- package/dist/reveal-animation.js +8779 -0
- package/dist/safari.cjs +90 -0
- package/dist/safari.d.ts +9 -0
- package/dist/safari.d.ts.map +1 -0
- package/dist/safari.js +68 -0
- package/dist/sandbox.cjs +94 -0
- package/dist/sandbox.d.ts +9 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +72 -0
- package/dist/search-and-toggle-navigation-bar.cjs +51 -0
- package/dist/search-and-toggle-navigation-bar.d.ts +10 -0
- package/dist/search-and-toggle-navigation-bar.d.ts.map +1 -0
- package/dist/search-and-toggle-navigation-bar.js +29 -0
- package/dist/select.cjs +38 -168
- package/dist/select.d.ts +38 -41
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +34 -164
- package/dist/separator.d.ts +5 -6
- package/dist/separator.d.ts.map +1 -0
- package/dist/sidebar.cjs +1134 -0
- package/dist/sidebar.d.ts +80 -0
- package/dist/sidebar.d.ts.map +1 -0
- package/dist/sidebar.js +1090 -0
- package/dist/simple-navigation-bar.cjs +45 -0
- package/dist/simple-navigation-bar.d.ts +11 -0
- package/dist/simple-navigation-bar.d.ts.map +1 -0
- package/dist/simple-navigation-bar.js +23 -0
- package/dist/skeleton.cjs +15 -148
- package/dist/skeleton.d.ts +11 -53
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +15 -148
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +4 -5
- package/dist/slider.d.ts.map +1 -0
- package/dist/slider.js +1 -1
- package/dist/status-dashboard-navigation-bar.cjs +51 -0
- package/dist/status-dashboard-navigation-bar.d.ts +10 -0
- package/dist/status-dashboard-navigation-bar.d.ts.map +1 -0
- package/dist/status-dashboard-navigation-bar.js +29 -0
- package/dist/status.cjs +85 -0
- package/dist/status.d.ts +23 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +62 -0
- package/dist/stock-screener.cjs +44 -0
- package/dist/stock-screener.d.ts +4 -0
- package/dist/stock-screener.d.ts.map +1 -0
- package/dist/stock-screener.js +42 -0
- package/dist/strategy-builder.d.ts +6 -8
- package/dist/strategy-builder.d.ts.map +1 -0
- package/dist/switch.cjs +2 -2
- package/dist/switch.d.ts +4 -8
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.js +2 -2
- package/dist/symbol-info.cjs +44 -0
- package/dist/symbol-info.d.ts +9 -0
- package/dist/symbol-info.d.ts.map +1 -0
- package/dist/symbol-info.js +42 -0
- package/dist/table.cjs +74 -192
- package/dist/table.d.ts +23 -25
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +53 -171
- package/dist/tabs.d.ts +12 -13
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tag.cjs +14 -147
- package/dist/tag.d.ts +4 -5
- package/dist/tag.d.ts.map +1 -0
- package/dist/tag.js +14 -147
- package/dist/tags.cjs +385 -0
- package/dist/tags.d.ts +13 -0
- package/dist/tags.d.ts.map +1 -0
- package/dist/tags.js +364 -0
- package/dist/team-switcher-navigation-bar.cjs +51 -0
- package/dist/team-switcher-navigation-bar.d.ts +10 -0
- package/dist/team-switcher-navigation-bar.d.ts.map +1 -0
- package/dist/team-switcher-navigation-bar.js +29 -0
- package/dist/technical-analysis.cjs +69 -0
- package/dist/technical-analysis.d.ts +13 -0
- package/dist/technical-analysis.d.ts.map +1 -0
- package/dist/technical-analysis.js +67 -0
- package/dist/terminal.cjs +372 -0
- package/dist/terminal.d.ts +21 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/terminal.js +350 -0
- package/dist/textarea.d.ts +5 -6
- package/dist/textarea.d.ts.map +1 -0
- package/dist/ticker-tape.cjs +54 -0
- package/dist/ticker-tape.d.ts +4 -0
- package/dist/ticker-tape.d.ts.map +1 -0
- package/dist/ticker-tape.js +52 -0
- package/dist/ticker.cjs +66 -0
- package/dist/ticker.d.ts +10 -0
- package/dist/ticker.d.ts.map +1 -0
- package/dist/ticker.js +44 -0
- package/dist/timeline.cjs +317 -0
- package/dist/timeline.d.ts +20 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +295 -0
- package/dist/toaster.d.ts +4 -5
- package/dist/toaster.d.ts.map +1 -0
- package/dist/toggle.cjs +62 -0
- package/dist/toggle.d.ts +26 -0
- package/dist/toggle.d.ts.map +1 -0
- package/dist/toggle.js +57 -0
- package/dist/tooltip.d.ts +3 -5
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/trading-panel.cjs +212 -0
- package/dist/trading-panel.d.ts +7 -0
- package/dist/trading-panel.d.ts.map +1 -0
- package/dist/trading-panel.js +207 -0
- package/dist/two-tier-navigation-bar.cjs +51 -0
- package/dist/two-tier-navigation-bar.d.ts +10 -0
- package/dist/two-tier-navigation-bar.d.ts.map +1 -0
- package/dist/two-tier-navigation-bar.js +29 -0
- package/dist/underline-navigation-bar.cjs +51 -0
- package/dist/underline-navigation-bar.d.ts +10 -0
- package/dist/underline-navigation-bar.d.ts.map +1 -0
- package/dist/underline-navigation-bar.js +29 -0
- package/dist/use-narrow.d.ts +6 -7
- package/dist/use-narrow.d.ts.map +1 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils.cjs +6 -7
- package/dist/utils.d.ts +13 -5
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +1 -9
- package/dist/vite.d.ts +3 -3
- package/dist/vite.d.ts.map +1 -0
- package/dist/white-label.d.ts +12 -12
- package/dist/white-label.d.ts.map +1 -0
- package/dist/youtube-pip-player.cjs +489 -0
- package/dist/youtube-pip-player.d.ts +41 -0
- package/dist/youtube-pip-player.d.ts.map +1 -0
- package/dist/youtube-pip-player.js +466 -0
- package/package.json +769 -66
- package/src/3d-button.tsx +346 -0
- package/src/3d-card.tsx +271 -0
- package/src/3d-carousel.tsx +444 -0
- package/src/3d-grid.tsx +448 -0
- package/src/3d-marquee.tsx +422 -0
- package/src/3d-model-viewer.tsx +659 -0
- package/src/3d-pin.tsx +37 -0
- package/src/3d-scene.tsx +629 -0
- package/src/3d-text.tsx +442 -0
- package/src/advanced-chart.tsx +63 -0
- package/src/advanced-navigation-bar.tsx +83 -0
- package/src/ai-actions.tsx +60 -0
- package/src/ai-agents.tsx +1174 -0
- package/src/ai-assistant.tsx +227 -0
- package/src/ai-chat.tsx +554 -0
- package/src/ai-code.tsx +1331 -0
- package/src/ai-model-selector-navigation-bar.tsx +78 -0
- package/src/ai-models.tsx +58 -0
- package/src/ai-playground.tsx +429 -0
- package/src/ai-tools.tsx +383 -0
- package/src/ai-vision.tsx +1220 -0
- package/src/ai-voice-settings.tsx +726 -0
- package/src/ai-voice.tsx +735 -0
- package/src/android.tsx +92 -0
- package/src/animated-background.tsx +625 -0
- package/src/animated-beam.tsx +110 -0
- package/src/animated-cursor.tsx +406 -0
- package/src/animated-icon.tsx +520 -0
- package/src/animated-list.tsx +508 -0
- package/src/animated-number.tsx +485 -0
- package/src/animated-testimonials.tsx +119 -0
- package/src/animated-text.tsx +481 -0
- package/src/animated-tooltip.tsx +54 -0
- package/src/announcement.tsx +55 -0
- package/src/app-switcher-navigation-bar.tsx +76 -0
- package/src/apple-cards-carousel.tsx +349 -0
- package/src/apple-hello-effect.tsx +50 -0
- package/src/auth.tsx +9 -8
- package/src/avatar.tsx +1 -1
- package/src/badge.tsx +27 -30
- package/src/banner.tsx +62 -0
- package/src/breadcrumb-and-filters-navigation-bar.tsx +40 -0
- package/src/breadcrumb-navigation-bar.tsx +43 -0
- package/src/button.tsx +10 -9
- package/src/calendar.tsx +62 -0
- package/src/centered-logo-navigation-bar.tsx +43 -0
- package/src/chart.tsx +372 -0
- package/src/choicebox.tsx +89 -0
- package/src/chrome.tsx +41 -40
- package/src/code-block.tsx +278 -0
- package/src/code-compare.tsx +551 -0
- package/src/code-diff.tsx +573 -0
- package/src/code-editor.tsx +250 -0
- package/src/code-explorer.tsx +403 -0
- package/src/code-preview.tsx +488 -0
- package/src/code-snippet.tsx +336 -0
- package/src/code-tabs.tsx +78 -0
- package/src/code-terminal.tsx +530 -0
- package/src/collaboration-navigation-bar.tsx +50 -0
- package/src/collapsible.tsx +3 -2
- package/src/color-picker.tsx +68 -0
- package/src/combobox.tsx +87 -0
- package/src/communication-navigation-bar.tsx +42 -0
- package/src/company-profile.tsx +67 -0
- package/src/comparison.tsx +68 -0
- package/src/context-switcher-navigation-bar.tsx +39 -0
- package/src/credit-card.tsx +72 -0
- package/src/crypto-screener.tsx +57 -0
- package/src/cursor.tsx +61 -0
- package/src/dashboard-navigation-bar.tsx +49 -0
- package/src/dialog-stack.tsx +55 -0
- package/src/dialog.tsx +16 -15
- package/src/direction.tsx +40 -0
- package/src/dock.tsx +172 -0
- package/src/dropzone.tsx +106 -0
- package/src/e-commerce-navigation-bar.tsx +54 -0
- package/src/editor.tsx +85 -0
- package/src/empty.tsx +117 -0
- package/src/field.tsx +2 -1
- package/src/financials.tsx +85 -0
- package/src/forex-screener.tsx +58 -0
- package/src/gantt.tsx +68 -0
- package/src/grid-pattern.tsx +353 -0
- package/src/hooks/use-mobile.ts +29 -0
- package/src/icon-navigation-bar.tsx +36 -0
- package/src/image-crop.tsx +67 -0
- package/src/image-zoom.tsx +64 -0
- package/src/image.tsx +2 -1
- package/src/index.ts +123 -0
- package/src/input-otp.tsx +72 -0
- package/src/iphone-15-pro.tsx +69 -0
- package/src/item.tsx +193 -0
- package/src/kanban.tsx +772 -0
- package/src/kbd.tsx +32 -0
- package/src/limelight-nav-navigation-bar.tsx +39 -0
- package/src/limelight-nav.tsx +101 -0
- package/src/link.tsx +18 -18
- package/src/list.tsx +22 -0
- package/src/magnetic.tsx +54 -0
- package/src/market-overview.tsx +116 -0
- package/src/marquee.tsx +62 -0
- package/src/menu-dock.tsx +56 -0
- package/src/menubar.tsx +149 -0
- package/src/message-dock.tsx +89 -0
- package/src/mini-calendar.tsx +121 -0
- package/src/minimal-tiptap.tsx +32 -0
- package/src/motion-highlight.tsx +55 -0
- package/src/music-player.tsx +413 -0
- package/src/native-select.tsx +63 -0
- package/src/news-timeline.tsx +56 -0
- package/src/order-entry.tsx +162 -0
- package/src/orders-history.tsx +115 -0
- package/src/pagination.tsx +118 -0
- package/src/particles-background.tsx +225 -0
- package/src/pill.tsx +61 -0
- package/src/pin-input.tsx +1 -1
- package/src/pixel-image.tsx +64 -0
- package/src/popover.tsx +10 -9
- package/src/positions-list.tsx +108 -0
- package/src/progress-circle.tsx +2 -1
- package/src/pulse-animation.tsx +606 -0
- package/src/qr-code.tsx +64 -0
- package/src/relative-time.tsx +84 -0
- package/src/resizable.tsx +46 -0
- package/src/reveal-animation.tsx +532 -0
- package/src/safari.tsx +115 -0
- package/src/sandbox.tsx +83 -0
- package/src/search-and-toggle-navigation-bar.tsx +39 -0
- package/src/select.tsx +31 -30
- package/src/sidebar.tsx +723 -0
- package/src/simple-navigation-bar.tsx +39 -0
- package/src/skeleton.tsx +20 -168
- package/src/slider.tsx +2 -1
- package/src/status-dashboard-navigation-bar.tsx +39 -0
- package/src/status.tsx +63 -0
- package/src/stock-screener.tsx +58 -0
- package/src/switch.tsx +3 -3
- package/src/symbol-info.tsx +64 -0
- package/src/table.tsx +26 -25
- package/src/tags.tsx +62 -0
- package/src/team-switcher-navigation-bar.tsx +39 -0
- package/src/technical-analysis.tsx +99 -0
- package/src/terminal.tsx +399 -0
- package/src/ticker-tape.tsx +68 -0
- package/src/ticker.tsx +52 -0
- package/src/timeline.tsx +412 -0
- package/src/toggle.tsx +84 -0
- package/src/trading-panel.tsx +262 -0
- package/src/two-tier-navigation-bar.tsx +39 -0
- package/src/underline-navigation-bar.tsx +39 -0
- package/src/utils/cn.ts +3 -7
- package/src/utils.ts +12 -6
- package/src/youtube-pip-player.tsx +606 -0
- package/tokens.css +22 -0
- package/dist/accordion.d.cts +0 -41
- package/dist/alert.d.cts +0 -30
- package/dist/auth.d.cts +0 -80
- package/dist/avatar.d.cts +0 -25
- package/dist/badge.d.cts +0 -19
- package/dist/bank.d.cts +0 -83
- package/dist/button.d.cts +0 -51
- package/dist/checkbox.d.cts +0 -32
- package/dist/chrome.d.cts +0 -93
- package/dist/close-button.d.cts +0 -9
- package/dist/collapsible.d.cts +0 -24
- package/dist/color-mode.d.cts +0 -25
- package/dist/dialog.d.cts +0 -118
- package/dist/drawer.d.cts +0 -69
- package/dist/empty-state.d.cts +0 -13
- package/dist/expiration-selector.d.cts +0 -16
- package/dist/field.d.cts +0 -23
- package/dist/greeks-display.d.cts +0 -14
- package/dist/gui.d.cts +0 -2
- package/dist/heading.d.cts +0 -8
- package/dist/iam.d.cts +0 -65
- package/dist/icon-button.d.cts +0 -37
- package/dist/icons.d.cts +0 -1
- package/dist/identity.d.cts +0 -64
- package/dist/image.d.cts +0 -57
- package/dist/index.d.cts +0 -60
- package/dist/input-group.d.cts +0 -17
- package/dist/input.d.cts +0 -37
- package/dist/link.d.cts +0 -37
- package/dist/lux.config.d.cts +0 -981
- package/dist/menu.d.cts +0 -68
- package/dist/next.d.cts +0 -32
- package/dist/option-chain.d.cts +0 -37
- package/dist/option-position.d.cts +0 -29
- package/dist/pin-input.d.cts +0 -25
- package/dist/pnl-diagram.d.cts +0 -11
- package/dist/popover.d.cts +0 -73
- package/dist/progress-circle.d.cts +0 -47
- package/dist/progress.d.cts +0 -28
- package/dist/provider.d.cts +0 -25
- package/dist/radio.d.cts +0 -53
- package/dist/rating.d.cts +0 -14
- package/dist/select.d.cts +0 -161
- package/dist/separator.d.cts +0 -13
- package/dist/skeleton.d.cts +0 -76
- package/dist/slider.d.cts +0 -24
- package/dist/strategy-builder.d.cts +0 -26
- package/dist/switch.d.cts +0 -27
- package/dist/table.d.cts +0 -107
- package/dist/tabs.d.cts +0 -34
- package/dist/tag.d.cts +0 -21
- package/dist/textarea.d.cts +0 -13
- package/dist/toaster.d.cts +0 -28
- package/dist/tooltip.d.cts +0 -38
- package/dist/use-narrow.d.cts +0 -12
- package/dist/utils.d.cts +0 -5
- package/dist/vite.d.cts +0 -29
- package/dist/white-label.d.cts +0 -59
package/src/kanban.tsx
ADDED
|
@@ -0,0 +1,772 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Box, css, sx, variants } from '@hanzo/ui'
|
|
5
|
+
import {
|
|
6
|
+
closestCorners,
|
|
7
|
+
DndContext,
|
|
8
|
+
DragEndEvent,
|
|
9
|
+
DragOverEvent,
|
|
10
|
+
DragOverlay,
|
|
11
|
+
DragStartEvent,
|
|
12
|
+
PointerSensor,
|
|
13
|
+
UniqueIdentifier,
|
|
14
|
+
useSensor,
|
|
15
|
+
useSensors,
|
|
16
|
+
} from "@dnd-kit/core"
|
|
17
|
+
import {
|
|
18
|
+
arrayMove,
|
|
19
|
+
SortableContext,
|
|
20
|
+
useSortable,
|
|
21
|
+
verticalListSortingStrategy,
|
|
22
|
+
} from "@dnd-kit/sortable"
|
|
23
|
+
import { CSS } from "@dnd-kit/utilities"
|
|
24
|
+
import {
|
|
25
|
+
Calendar,
|
|
26
|
+
Edit3,
|
|
27
|
+
MoreHorizontal,
|
|
28
|
+
Plus,
|
|
29
|
+
Search,
|
|
30
|
+
User,
|
|
31
|
+
X,
|
|
32
|
+
} from "lucide-react"
|
|
33
|
+
|
|
34
|
+
import { cn } from "./utils"
|
|
35
|
+
|
|
36
|
+
import { Badge } from "./badge"
|
|
37
|
+
import { Button } from "./button"
|
|
38
|
+
import { Card, CardContent, CardHeader } from "@hanzo/ui"
|
|
39
|
+
import {
|
|
40
|
+
Dialog,
|
|
41
|
+
DialogContent,
|
|
42
|
+
DialogDescription,
|
|
43
|
+
DialogFooter,
|
|
44
|
+
DialogHeader,
|
|
45
|
+
DialogTitle,
|
|
46
|
+
DialogTrigger,
|
|
47
|
+
} from "@hanzo/ui"
|
|
48
|
+
import {
|
|
49
|
+
DropdownMenu,
|
|
50
|
+
DropdownMenuContent,
|
|
51
|
+
DropdownMenuItem,
|
|
52
|
+
DropdownMenuTrigger,
|
|
53
|
+
} from "@hanzo/ui"
|
|
54
|
+
import { Input } from "./input"
|
|
55
|
+
import { Label } from "@hanzo/ui"
|
|
56
|
+
import {
|
|
57
|
+
Select,
|
|
58
|
+
SelectContent,
|
|
59
|
+
SelectItem,
|
|
60
|
+
SelectTrigger,
|
|
61
|
+
SelectValue,
|
|
62
|
+
} from "@hanzo/ui"
|
|
63
|
+
import { Textarea } from "./textarea"
|
|
64
|
+
|
|
65
|
+
// Types
|
|
66
|
+
export interface KanbanCard {
|
|
67
|
+
id: string
|
|
68
|
+
title: string
|
|
69
|
+
description?: string
|
|
70
|
+
labels?: KanbanLabel[]
|
|
71
|
+
priority?: "low" | "medium" | "high" | "urgent"
|
|
72
|
+
assignee?: string
|
|
73
|
+
dueDate?: string
|
|
74
|
+
createdAt: string
|
|
75
|
+
updatedAt: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface KanbanLabel {
|
|
79
|
+
id: string
|
|
80
|
+
name: string
|
|
81
|
+
color: string
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface KanbanColumn {
|
|
85
|
+
id: string
|
|
86
|
+
title: string
|
|
87
|
+
cards: KanbanCard[]
|
|
88
|
+
limit?: number
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface KanbanBoard {
|
|
92
|
+
id: string
|
|
93
|
+
title: string
|
|
94
|
+
columns: KanbanColumn[]
|
|
95
|
+
labels: KanbanLabel[]
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Priority variants
|
|
99
|
+
const priorityVariants = variants(
|
|
100
|
+
"inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-semibold",
|
|
101
|
+
{
|
|
102
|
+
variants: {
|
|
103
|
+
priority: {
|
|
104
|
+
low: "border-[var(--color-link-primary)] bg-[var(--color-link-primary)] text-[var(--color-link-primary)] dark:border-[var(--color-link-primary)] dark:bg-[var(--color-link-primary)]/20 dark:text-[var(--color-link-primary)]",
|
|
105
|
+
medium:
|
|
106
|
+
"border-[var(--lux-state-notice)] bg-[var(--lux-state-notice)] text-[var(--lux-state-notice)] dark:border-[var(--lux-state-notice)] dark:bg-[var(--lux-state-notice)]/20 dark:text-[var(--lux-state-notice)]",
|
|
107
|
+
high: "border-[var(--lux-state-notice)] bg-[var(--lux-state-notice)] text-[var(--lux-state-notice)] dark:border-[var(--lux-state-notice)] dark:bg-[var(--lux-state-notice)]/20 dark:text-[var(--lux-state-notice)]",
|
|
108
|
+
urgent:
|
|
109
|
+
"border-[var(--lux-state-error)] bg-[var(--lux-state-error)] text-[var(--lux-state-error)] dark:border-[var(--lux-state-error)] dark:bg-[var(--lux-state-error)]/20 dark:text-[var(--lux-state-error)]",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
defaultVariants: {
|
|
113
|
+
priority: "low",
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
// Sortable Card Component
|
|
119
|
+
function SortableCard({
|
|
120
|
+
card,
|
|
121
|
+
onEdit,
|
|
122
|
+
onDelete,
|
|
123
|
+
}: {
|
|
124
|
+
card: KanbanCard
|
|
125
|
+
onEdit: (card: KanbanCard) => void
|
|
126
|
+
onDelete: (cardId: string) => void
|
|
127
|
+
}) {
|
|
128
|
+
const {
|
|
129
|
+
attributes,
|
|
130
|
+
listeners,
|
|
131
|
+
setNodeRef,
|
|
132
|
+
transform,
|
|
133
|
+
transition,
|
|
134
|
+
isDragging,
|
|
135
|
+
} = useSortable({ id: card.id })
|
|
136
|
+
|
|
137
|
+
const style = {
|
|
138
|
+
transform: CSS.Transform.toString(transform),
|
|
139
|
+
transition,
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<Box
|
|
144
|
+
ref={setNodeRef}
|
|
145
|
+
style={style}
|
|
146
|
+
{...attributes}
|
|
147
|
+
{...listeners}
|
|
148
|
+
className={cn(
|
|
149
|
+
"cursor-grab active:cursor-grabbing",
|
|
150
|
+
isDragging && "opacity-50"
|
|
151
|
+
)}
|
|
152
|
+
>
|
|
153
|
+
<KanbanCardComponent card={card} onEdit={onEdit} onDelete={onDelete} />
|
|
154
|
+
</Box>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Card Component
|
|
159
|
+
function KanbanCardComponent({
|
|
160
|
+
card,
|
|
161
|
+
onEdit,
|
|
162
|
+
onDelete,
|
|
163
|
+
}: {
|
|
164
|
+
card: KanbanCard
|
|
165
|
+
onEdit: (card: KanbanCard) => void
|
|
166
|
+
onDelete: (cardId: string) => void
|
|
167
|
+
}) {
|
|
168
|
+
return (
|
|
169
|
+
<Card {...sx('mb-3 group hover:shadow-md transition-shadow')}>
|
|
170
|
+
<CardHeader {...sx('pb-3')}>
|
|
171
|
+
<Box className="flex items-start justify-between">
|
|
172
|
+
<Box className="flex-1 min-w-0">
|
|
173
|
+
<Box tag="h4" className="font-medium text-sm leading-tight mb-2 break-words">
|
|
174
|
+
{card.title}
|
|
175
|
+
</Box>
|
|
176
|
+
{card.description && (
|
|
177
|
+
<Box tag="p" className="text-xs text-muted-foreground line-clamp-2 mb-2">
|
|
178
|
+
{card.description}
|
|
179
|
+
</Box>
|
|
180
|
+
)}
|
|
181
|
+
|
|
182
|
+
{/* Labels */}
|
|
183
|
+
{card.labels && card.labels.length > 0 && (
|
|
184
|
+
<Box className="flex flex-wrap gap-1 mb-2">
|
|
185
|
+
{card.labels.map((label) => (
|
|
186
|
+
<Badge
|
|
187
|
+
key={label.id}
|
|
188
|
+
variant="outline"
|
|
189
|
+
className="text-xs h-5"
|
|
190
|
+
style={{
|
|
191
|
+
backgroundColor: `${label.color}20`,
|
|
192
|
+
borderColor: label.color,
|
|
193
|
+
color: label.color,
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
{label.name}
|
|
197
|
+
</Badge>
|
|
198
|
+
))}
|
|
199
|
+
</Box>
|
|
200
|
+
)}
|
|
201
|
+
|
|
202
|
+
{/* Priority and Meta */}
|
|
203
|
+
<Box className="flex items-center justify-between text-xs">
|
|
204
|
+
<Box className="flex items-center gap-2">
|
|
205
|
+
{card.priority && (
|
|
206
|
+
<Box tag="span"
|
|
207
|
+
className={cn(
|
|
208
|
+
priorityVariants({ priority: card.priority })
|
|
209
|
+
)}
|
|
210
|
+
>
|
|
211
|
+
{card.priority}
|
|
212
|
+
</Box>
|
|
213
|
+
)}
|
|
214
|
+
{card.assignee && (
|
|
215
|
+
<Box className="flex items-center gap-1 text-muted-foreground">
|
|
216
|
+
<User style={css('h-3 w-3')} />
|
|
217
|
+
<span>{card.assignee}</span>
|
|
218
|
+
</Box>
|
|
219
|
+
)}
|
|
220
|
+
</Box>
|
|
221
|
+
|
|
222
|
+
<Box className="flex items-center gap-1">
|
|
223
|
+
{card.dueDate && (
|
|
224
|
+
<Box className="flex items-center gap-1 text-muted-foreground">
|
|
225
|
+
<Calendar style={css('h-3 w-3')} />
|
|
226
|
+
<span>{new Date(card.dueDate).toLocaleDateString()}</span>
|
|
227
|
+
</Box>
|
|
228
|
+
)}
|
|
229
|
+
|
|
230
|
+
<DropdownMenu>
|
|
231
|
+
<DropdownMenuTrigger asChild>
|
|
232
|
+
<Button
|
|
233
|
+
variant="ghost"
|
|
234
|
+
size="icon"
|
|
235
|
+
{...sx('h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity')}
|
|
236
|
+
>
|
|
237
|
+
<MoreHorizontal style={css('h-3 w-3')} />
|
|
238
|
+
</Button>
|
|
239
|
+
</DropdownMenuTrigger>
|
|
240
|
+
<DropdownMenuContent align="end">
|
|
241
|
+
<DropdownMenuItem onClick={() => onEdit(card)}>
|
|
242
|
+
<Edit3 style={css('h-4 w-4 mr-2')} />
|
|
243
|
+
Edit
|
|
244
|
+
</DropdownMenuItem>
|
|
245
|
+
<DropdownMenuItem
|
|
246
|
+
onClick={() => onDelete(card.id)}
|
|
247
|
+
className="text-destructive"
|
|
248
|
+
>
|
|
249
|
+
<X style={css('h-4 w-4 mr-2')} />
|
|
250
|
+
Delete
|
|
251
|
+
</DropdownMenuItem>
|
|
252
|
+
</DropdownMenuContent>
|
|
253
|
+
</DropdownMenu>
|
|
254
|
+
</Box>
|
|
255
|
+
</Box>
|
|
256
|
+
</Box>
|
|
257
|
+
</Box>
|
|
258
|
+
</CardHeader>
|
|
259
|
+
</Card>
|
|
260
|
+
)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Column Component
|
|
264
|
+
function KanbanColumnComponent({
|
|
265
|
+
column,
|
|
266
|
+
onAddCard,
|
|
267
|
+
onEditCard,
|
|
268
|
+
onDeleteCard,
|
|
269
|
+
}: {
|
|
270
|
+
column: KanbanColumn
|
|
271
|
+
onAddCard: (columnId: string) => void
|
|
272
|
+
onEditCard: (card: KanbanCard) => void
|
|
273
|
+
onDeleteCard: (cardId: string) => void
|
|
274
|
+
}) {
|
|
275
|
+
const { setNodeRef } = useSortable({ id: column.id })
|
|
276
|
+
|
|
277
|
+
return (
|
|
278
|
+
<Box
|
|
279
|
+
ref={setNodeRef}
|
|
280
|
+
className="bg-muted/50 rounded-lg p-4 min-w-[280px] max-w-[280px] flex flex-col"
|
|
281
|
+
>
|
|
282
|
+
{/* Column Header */}
|
|
283
|
+
<Box className="flex items-center justify-between mb-4">
|
|
284
|
+
<Box className="flex items-center gap-2">
|
|
285
|
+
<Box tag="h3" className="font-semibold text-sm">{column.title}</Box>
|
|
286
|
+
<Badge colorPalette="gray" {...sx('text-xs')}>
|
|
287
|
+
{column.cards.length}
|
|
288
|
+
{column.limit && `/${column.limit}`}
|
|
289
|
+
</Badge>
|
|
290
|
+
</Box>
|
|
291
|
+
<Button
|
|
292
|
+
variant="ghost"
|
|
293
|
+
size="icon"
|
|
294
|
+
{...sx('h-8 w-8')}
|
|
295
|
+
onClick={() => onAddCard(column.id)}
|
|
296
|
+
>
|
|
297
|
+
<Plus style={css('h-4 w-4')} />
|
|
298
|
+
</Button>
|
|
299
|
+
</Box>
|
|
300
|
+
|
|
301
|
+
{/* Cards Container */}
|
|
302
|
+
<SortableContext
|
|
303
|
+
items={column.cards.map((card) => card.id)}
|
|
304
|
+
strategy={verticalListSortingStrategy}
|
|
305
|
+
>
|
|
306
|
+
<Box className="flex-1 min-h-[200px]">
|
|
307
|
+
{column.cards.map((card) => (
|
|
308
|
+
<SortableCard
|
|
309
|
+
key={card.id}
|
|
310
|
+
card={card}
|
|
311
|
+
onEdit={onEditCard}
|
|
312
|
+
onDelete={onDeleteCard}
|
|
313
|
+
/>
|
|
314
|
+
))}
|
|
315
|
+
</Box>
|
|
316
|
+
</SortableContext>
|
|
317
|
+
</Box>
|
|
318
|
+
)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Card Form Dialog
|
|
322
|
+
function CardFormDialog({
|
|
323
|
+
open,
|
|
324
|
+
onOpenChange,
|
|
325
|
+
card,
|
|
326
|
+
onSave,
|
|
327
|
+
labels,
|
|
328
|
+
}: {
|
|
329
|
+
open: boolean
|
|
330
|
+
onOpenChange: (open: boolean) => void
|
|
331
|
+
card?: KanbanCard
|
|
332
|
+
onSave: (cardData: Partial<KanbanCard>) => void
|
|
333
|
+
labels: KanbanLabel[]
|
|
334
|
+
}) {
|
|
335
|
+
const [formData, setFormData] = React.useState({
|
|
336
|
+
title: card?.title || "",
|
|
337
|
+
description: card?.description || "",
|
|
338
|
+
priority: card?.priority || "low",
|
|
339
|
+
assignee: card?.assignee || "",
|
|
340
|
+
dueDate: card?.dueDate || "",
|
|
341
|
+
labels: card?.labels?.map((l) => l.id) || [],
|
|
342
|
+
})
|
|
343
|
+
|
|
344
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
345
|
+
e.preventDefault()
|
|
346
|
+
if (!formData.title.trim()) return
|
|
347
|
+
|
|
348
|
+
onSave({
|
|
349
|
+
...card,
|
|
350
|
+
...formData,
|
|
351
|
+
labels: labels.filter((l) => formData.labels.includes(l.id)),
|
|
352
|
+
updatedAt: new Date().toISOString(),
|
|
353
|
+
})
|
|
354
|
+
onOpenChange(false)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
React.useEffect(() => {
|
|
358
|
+
if (card) {
|
|
359
|
+
setFormData({
|
|
360
|
+
title: card.title,
|
|
361
|
+
description: card.description || "",
|
|
362
|
+
priority: card.priority || "low",
|
|
363
|
+
assignee: card.assignee || "",
|
|
364
|
+
dueDate: card.dueDate || "",
|
|
365
|
+
labels: card.labels?.map((l) => l.id) || [],
|
|
366
|
+
})
|
|
367
|
+
} else {
|
|
368
|
+
setFormData({
|
|
369
|
+
title: "",
|
|
370
|
+
description: "",
|
|
371
|
+
priority: "low",
|
|
372
|
+
assignee: "",
|
|
373
|
+
dueDate: "",
|
|
374
|
+
labels: [],
|
|
375
|
+
})
|
|
376
|
+
}
|
|
377
|
+
}, [card])
|
|
378
|
+
|
|
379
|
+
return (
|
|
380
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
381
|
+
<DialogContent {...sx('max-w-md')}>
|
|
382
|
+
<DialogHeader>
|
|
383
|
+
<DialogTitle>{card ? "Edit Card" : "Create Card"}</DialogTitle>
|
|
384
|
+
<DialogDescription>
|
|
385
|
+
{card
|
|
386
|
+
? "Update the card details below."
|
|
387
|
+
: "Create a new card for your kanban board."}
|
|
388
|
+
</DialogDescription>
|
|
389
|
+
</DialogHeader>
|
|
390
|
+
|
|
391
|
+
<Box tag="form" onSubmit={handleSubmit} className="space-y-4">
|
|
392
|
+
<div>
|
|
393
|
+
<Label htmlFor="title">Title *</Label>
|
|
394
|
+
<Input
|
|
395
|
+
id="title"
|
|
396
|
+
value={formData.title}
|
|
397
|
+
onChange={(e) =>
|
|
398
|
+
setFormData((prev) => ({ ...prev, title: e.target.value }))
|
|
399
|
+
}
|
|
400
|
+
placeholder="Enter card title..."
|
|
401
|
+
required
|
|
402
|
+
/>
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
<div>
|
|
406
|
+
<Label htmlFor="description">Description</Label>
|
|
407
|
+
<Textarea
|
|
408
|
+
id="description"
|
|
409
|
+
value={formData.description}
|
|
410
|
+
onChange={(e) =>
|
|
411
|
+
setFormData((prev) => ({
|
|
412
|
+
...prev,
|
|
413
|
+
description: e.target.value,
|
|
414
|
+
}))
|
|
415
|
+
}
|
|
416
|
+
placeholder="Enter card description..."
|
|
417
|
+
rows={3}
|
|
418
|
+
/>
|
|
419
|
+
</div>
|
|
420
|
+
|
|
421
|
+
<Box className="grid grid-cols-2 gap-4">
|
|
422
|
+
<div>
|
|
423
|
+
<Label htmlFor="priority">Priority</Label>
|
|
424
|
+
<Select
|
|
425
|
+
value={formData.priority}
|
|
426
|
+
onValueChange={(value) =>
|
|
427
|
+
setFormData((prev) => ({ ...prev, priority: value as any }))
|
|
428
|
+
}
|
|
429
|
+
>
|
|
430
|
+
<SelectTrigger>
|
|
431
|
+
<SelectValue />
|
|
432
|
+
</SelectTrigger>
|
|
433
|
+
<SelectContent>
|
|
434
|
+
<SelectItem value="low">Low</SelectItem>
|
|
435
|
+
<SelectItem value="medium">Medium</SelectItem>
|
|
436
|
+
<SelectItem value="high">High</SelectItem>
|
|
437
|
+
<SelectItem value="urgent">Urgent</SelectItem>
|
|
438
|
+
</SelectContent>
|
|
439
|
+
</Select>
|
|
440
|
+
</div>
|
|
441
|
+
|
|
442
|
+
<div>
|
|
443
|
+
<Label htmlFor="assignee">Assignee</Label>
|
|
444
|
+
<Input
|
|
445
|
+
id="assignee"
|
|
446
|
+
value={formData.assignee}
|
|
447
|
+
onChange={(e) =>
|
|
448
|
+
setFormData((prev) => ({ ...prev, assignee: e.target.value }))
|
|
449
|
+
}
|
|
450
|
+
placeholder="Assign to..."
|
|
451
|
+
/>
|
|
452
|
+
</div>
|
|
453
|
+
</Box>
|
|
454
|
+
|
|
455
|
+
<div>
|
|
456
|
+
<Label htmlFor="dueDate">Due Date</Label>
|
|
457
|
+
<Input
|
|
458
|
+
id="dueDate"
|
|
459
|
+
type="date"
|
|
460
|
+
value={formData.dueDate}
|
|
461
|
+
onChange={(e) =>
|
|
462
|
+
setFormData((prev) => ({ ...prev, dueDate: e.target.value }))
|
|
463
|
+
}
|
|
464
|
+
/>
|
|
465
|
+
</div>
|
|
466
|
+
|
|
467
|
+
<DialogFooter>
|
|
468
|
+
<Button
|
|
469
|
+
type="button"
|
|
470
|
+
variant="outline"
|
|
471
|
+
onClick={() => onOpenChange(false)}
|
|
472
|
+
>
|
|
473
|
+
Cancel
|
|
474
|
+
</Button>
|
|
475
|
+
<Button type="submit">{card ? "Update" : "Create"} Card</Button>
|
|
476
|
+
</DialogFooter>
|
|
477
|
+
</Box>
|
|
478
|
+
</DialogContent>
|
|
479
|
+
</Dialog>
|
|
480
|
+
)
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// Main Kanban Board Component
|
|
484
|
+
export interface KanbanBoardProps {
|
|
485
|
+
board: KanbanBoard
|
|
486
|
+
onUpdateBoard: (board: KanbanBoard) => void
|
|
487
|
+
className?: string
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export function KanbanBoard({
|
|
491
|
+
board,
|
|
492
|
+
onUpdateBoard,
|
|
493
|
+
className,
|
|
494
|
+
}: KanbanBoardProps) {
|
|
495
|
+
const [activeCard, setActiveCard] = React.useState<KanbanCard | null>(null)
|
|
496
|
+
const [searchQuery, setSearchQuery] = React.useState("")
|
|
497
|
+
const [cardFormOpen, setCardFormOpen] = React.useState(false)
|
|
498
|
+
const [editingCard, setEditingCard] = React.useState<KanbanCard | undefined>(
|
|
499
|
+
undefined
|
|
500
|
+
)
|
|
501
|
+
const [activeColumnId, setActiveColumnId] = React.useState<string>("")
|
|
502
|
+
|
|
503
|
+
const sensors = useSensors(
|
|
504
|
+
useSensor(PointerSensor, {
|
|
505
|
+
activationConstraint: {
|
|
506
|
+
distance: 8,
|
|
507
|
+
},
|
|
508
|
+
})
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
// Filter cards based on search query
|
|
512
|
+
const filteredBoard = React.useMemo(() => {
|
|
513
|
+
if (!searchQuery.trim()) return board
|
|
514
|
+
|
|
515
|
+
const filtered = {
|
|
516
|
+
...board,
|
|
517
|
+
columns: board.columns.map((column) => ({
|
|
518
|
+
...column,
|
|
519
|
+
cards: column.cards.filter(
|
|
520
|
+
(card) =>
|
|
521
|
+
card.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
522
|
+
card.description
|
|
523
|
+
?.toLowerCase()
|
|
524
|
+
.includes(searchQuery.toLowerCase()) ||
|
|
525
|
+
card.labels?.some((label) =>
|
|
526
|
+
label.name.toLowerCase().includes(searchQuery.toLowerCase())
|
|
527
|
+
)
|
|
528
|
+
),
|
|
529
|
+
})),
|
|
530
|
+
}
|
|
531
|
+
return filtered
|
|
532
|
+
}, [board, searchQuery])
|
|
533
|
+
|
|
534
|
+
const handleDragStart = (event: DragStartEvent) => {
|
|
535
|
+
const { active } = event
|
|
536
|
+
const card = board.columns
|
|
537
|
+
.flatMap((col) => col.cards)
|
|
538
|
+
.find((card) => card.id === active.id)
|
|
539
|
+
setActiveCard(card || null)
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const handleDragOver = (event: DragOverEvent) => {
|
|
543
|
+
const { active, over } = event
|
|
544
|
+
if (!over) return
|
|
545
|
+
|
|
546
|
+
const activeId = active.id
|
|
547
|
+
const overId = over.id
|
|
548
|
+
|
|
549
|
+
// Find the containers
|
|
550
|
+
const activeContainer = findContainer(activeId)
|
|
551
|
+
const overContainer = findContainer(overId)
|
|
552
|
+
|
|
553
|
+
if (
|
|
554
|
+
!activeContainer ||
|
|
555
|
+
!overContainer ||
|
|
556
|
+
activeContainer === overContainer
|
|
557
|
+
) {
|
|
558
|
+
return
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// Move card between columns
|
|
562
|
+
const updatedBoard = { ...board }
|
|
563
|
+
const activeColumnIndex = updatedBoard.columns.findIndex(
|
|
564
|
+
(col) => col.id === activeContainer
|
|
565
|
+
)
|
|
566
|
+
const overColumnIndex = updatedBoard.columns.findIndex(
|
|
567
|
+
(col) => col.id === overContainer
|
|
568
|
+
)
|
|
569
|
+
|
|
570
|
+
const activeColumn = updatedBoard.columns[activeColumnIndex]
|
|
571
|
+
const overColumn = updatedBoard.columns[overColumnIndex]
|
|
572
|
+
|
|
573
|
+
const activeCardIndex = activeColumn.cards.findIndex(
|
|
574
|
+
(card) => card.id === activeId
|
|
575
|
+
)
|
|
576
|
+
const [movedCard] = activeColumn.cards.splice(activeCardIndex, 1)
|
|
577
|
+
|
|
578
|
+
// Check column limit
|
|
579
|
+
if (overColumn.limit && overColumn.cards.length >= overColumn.limit) {
|
|
580
|
+
return
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
overColumn.cards.push(movedCard)
|
|
584
|
+
onUpdateBoard(updatedBoard)
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
const handleDragEnd = (event: DragEndEvent) => {
|
|
588
|
+
const { active, over } = event
|
|
589
|
+
setActiveCard(null)
|
|
590
|
+
|
|
591
|
+
if (!over) return
|
|
592
|
+
|
|
593
|
+
const activeId = active.id
|
|
594
|
+
const overId = over.id
|
|
595
|
+
|
|
596
|
+
const activeContainer = findContainer(activeId)
|
|
597
|
+
const overContainer = findContainer(overId)
|
|
598
|
+
|
|
599
|
+
if (!activeContainer || !overContainer) return
|
|
600
|
+
|
|
601
|
+
const activeColumnIndex = board.columns.findIndex(
|
|
602
|
+
(col) => col.id === activeContainer
|
|
603
|
+
)
|
|
604
|
+
const activeColumn = board.columns[activeColumnIndex]
|
|
605
|
+
|
|
606
|
+
if (activeContainer === overContainer) {
|
|
607
|
+
// Reordering within the same column
|
|
608
|
+
const oldIndex = activeColumn.cards.findIndex(
|
|
609
|
+
(card) => card.id === activeId
|
|
610
|
+
)
|
|
611
|
+
const newIndex = activeColumn.cards.findIndex(
|
|
612
|
+
(card) => card.id === overId
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
if (oldIndex !== newIndex) {
|
|
616
|
+
const updatedBoard = { ...board }
|
|
617
|
+
updatedBoard.columns[activeColumnIndex].cards = arrayMove(
|
|
618
|
+
activeColumn.cards,
|
|
619
|
+
oldIndex,
|
|
620
|
+
newIndex
|
|
621
|
+
)
|
|
622
|
+
onUpdateBoard(updatedBoard)
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const findContainer = (id: UniqueIdentifier): string | undefined => {
|
|
628
|
+
// Check if it's a column
|
|
629
|
+
if (board.columns.some((col) => col.id === id)) {
|
|
630
|
+
return id as string
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// Find which column contains this card
|
|
634
|
+
return board.columns.find((col) => col.cards.some((card) => card.id === id))
|
|
635
|
+
?.id
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
const handleAddCard = (columnId: string) => {
|
|
639
|
+
setActiveColumnId(columnId)
|
|
640
|
+
setEditingCard(undefined)
|
|
641
|
+
setCardFormOpen(true)
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
const handleEditCard = (card: KanbanCard) => {
|
|
645
|
+
setEditingCard(card)
|
|
646
|
+
setActiveColumnId("")
|
|
647
|
+
setCardFormOpen(true)
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
const handleSaveCard = (cardData: Partial<KanbanCard>) => {
|
|
651
|
+
const updatedBoard = { ...board }
|
|
652
|
+
|
|
653
|
+
if (editingCard) {
|
|
654
|
+
// Update existing card
|
|
655
|
+
const columnIndex = updatedBoard.columns.findIndex((col) =>
|
|
656
|
+
col.cards.some((card) => card.id === editingCard.id)
|
|
657
|
+
)
|
|
658
|
+
if (columnIndex !== -1) {
|
|
659
|
+
const cardIndex = updatedBoard.columns[columnIndex].cards.findIndex(
|
|
660
|
+
(card) => card.id === editingCard.id
|
|
661
|
+
)
|
|
662
|
+
if (cardIndex !== -1) {
|
|
663
|
+
updatedBoard.columns[columnIndex].cards[cardIndex] = {
|
|
664
|
+
...editingCard,
|
|
665
|
+
...cardData,
|
|
666
|
+
} as KanbanCard
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
} else {
|
|
670
|
+
// Create new card
|
|
671
|
+
const columnIndex = updatedBoard.columns.findIndex(
|
|
672
|
+
(col) => col.id === activeColumnId
|
|
673
|
+
)
|
|
674
|
+
if (columnIndex !== -1) {
|
|
675
|
+
const newCard: KanbanCard = {
|
|
676
|
+
id: `card-${Date.now()}`,
|
|
677
|
+
title: cardData.title!,
|
|
678
|
+
description: cardData.description,
|
|
679
|
+
labels: cardData.labels,
|
|
680
|
+
priority: cardData.priority,
|
|
681
|
+
assignee: cardData.assignee,
|
|
682
|
+
dueDate: cardData.dueDate,
|
|
683
|
+
createdAt: new Date().toISOString(),
|
|
684
|
+
updatedAt: new Date().toISOString(),
|
|
685
|
+
}
|
|
686
|
+
updatedBoard.columns[columnIndex].cards.push(newCard)
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
onUpdateBoard(updatedBoard)
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
const handleDeleteCard = (cardId: string) => {
|
|
694
|
+
const updatedBoard = { ...board }
|
|
695
|
+
const columnIndex = updatedBoard.columns.findIndex((col) =>
|
|
696
|
+
col.cards.some((card) => card.id === cardId)
|
|
697
|
+
)
|
|
698
|
+
if (columnIndex !== -1) {
|
|
699
|
+
updatedBoard.columns[columnIndex].cards = updatedBoard.columns[
|
|
700
|
+
columnIndex
|
|
701
|
+
].cards.filter((card) => card.id !== cardId)
|
|
702
|
+
onUpdateBoard(updatedBoard)
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
return (
|
|
707
|
+
<Box className={cn("flex flex-col h-full", className)}>
|
|
708
|
+
{/* Header */}
|
|
709
|
+
<Box className="flex items-center justify-between p-4 border-b">
|
|
710
|
+
<Box tag="h1" className="text-2xl font-bold">{board.title}</Box>
|
|
711
|
+
<Box className="flex items-center gap-3">
|
|
712
|
+
<Box className="relative">
|
|
713
|
+
<Search style={css('absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground')} />
|
|
714
|
+
<Input
|
|
715
|
+
placeholder="Search cards..."
|
|
716
|
+
value={searchQuery}
|
|
717
|
+
onChange={(e) => setSearchQuery(e.target.value)}
|
|
718
|
+
{...sx('pl-9 w-64')}
|
|
719
|
+
/>
|
|
720
|
+
</Box>
|
|
721
|
+
</Box>
|
|
722
|
+
</Box>
|
|
723
|
+
|
|
724
|
+
{/* Board */}
|
|
725
|
+
<Box className="flex-1 overflow-x-auto">
|
|
726
|
+
<Box className="h-full p-4">
|
|
727
|
+
<DndContext
|
|
728
|
+
sensors={sensors}
|
|
729
|
+
collisionDetection={closestCorners}
|
|
730
|
+
onDragStart={handleDragStart}
|
|
731
|
+
onDragOver={handleDragOver}
|
|
732
|
+
onDragEnd={handleDragEnd}
|
|
733
|
+
>
|
|
734
|
+
<Box className="flex gap-6 h-full pb-4">
|
|
735
|
+
{filteredBoard.columns.map((column) => (
|
|
736
|
+
<KanbanColumnComponent
|
|
737
|
+
key={column.id}
|
|
738
|
+
column={column}
|
|
739
|
+
onAddCard={handleAddCard}
|
|
740
|
+
onEditCard={handleEditCard}
|
|
741
|
+
onDeleteCard={handleDeleteCard}
|
|
742
|
+
/>
|
|
743
|
+
))}
|
|
744
|
+
</Box>
|
|
745
|
+
|
|
746
|
+
<DragOverlay>
|
|
747
|
+
{activeCard ? (
|
|
748
|
+
<KanbanCardComponent
|
|
749
|
+
card={activeCard}
|
|
750
|
+
onEdit={() => {}}
|
|
751
|
+
onDelete={() => {}}
|
|
752
|
+
/>
|
|
753
|
+
) : null}
|
|
754
|
+
</DragOverlay>
|
|
755
|
+
</DndContext>
|
|
756
|
+
</Box>
|
|
757
|
+
</Box>
|
|
758
|
+
|
|
759
|
+
{/* Card Form Dialog */}
|
|
760
|
+
<CardFormDialog
|
|
761
|
+
open={cardFormOpen}
|
|
762
|
+
onOpenChange={setCardFormOpen}
|
|
763
|
+
card={editingCard}
|
|
764
|
+
onSave={handleSaveCard}
|
|
765
|
+
labels={board.labels}
|
|
766
|
+
/>
|
|
767
|
+
</Box>
|
|
768
|
+
)
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// Export default for registry
|
|
772
|
+
export default KanbanBoard
|