@flikk/ui 1.0.0-beta.1 → 1.0.0-beta.11
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/dist/components/ai/ApprovalCard/ApprovalCard.js +3 -2
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +2 -2
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.animations.d.ts +25 -0
- package/dist/components/ai/PromptInput/PromptInput.animations.js +61 -0
- package/dist/components/ai/PromptInput/PromptInput.js +264 -31
- package/dist/components/ai/PromptInput/PromptInput.theme.js +6 -1
- package/dist/components/ai/PromptInput/PromptInput.types.d.ts +68 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.d.ts +10 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.js +258 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.types.d.ts +17 -0
- package/dist/components/ai/PromptInput/index.d.ts +1 -0
- package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.js +1 -1
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -2
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +51 -27
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +4 -5
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +5 -12
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +20 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +2 -2
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +2 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +27 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +134 -0
- package/dist/components/ai/StreamingResponse/index.d.ts +3 -1
- package/dist/components/ai/ThinkingIndicator/ThinkingIndicator.theme.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +6 -6
- package/dist/components/ai/index.js +1 -0
- package/dist/components/charts/ActivityRings/ActivityRings.js +1 -1
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +2 -2
- package/dist/components/charts/BarChart/BarChart.js +3 -3
- package/dist/components/charts/ChartContainer.js +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +2 -2
- package/dist/components/charts/DonutChart/DonutChart.theme.js +1 -1
- package/dist/components/charts/DonutChart/DonutChart.types.d.ts +1 -2
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.types.d.ts +1 -2
- package/dist/components/charts/FunnelChart/FunnelChart.js +7 -7
- package/dist/components/charts/Heatmap/Heatmap.theme.js +1 -1
- package/dist/components/charts/Heatmap/HeatmapCell.js +1 -1
- package/dist/components/charts/Heatmap/HeatmapLegend.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.theme.js +2 -2
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +1 -1
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +2 -2
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +2 -2
- package/dist/components/charts/shared/ChartErrorBoundary/ChartErrorBoundary.js +1 -1
- package/dist/components/charts/shared/ChartLegend/ChartLegendContent.js +1 -1
- package/dist/components/charts/shared/ChartText/ChartText.js +1 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +4 -4
- package/dist/components/core/Accordion/Accordion.animations.d.ts +6 -1
- package/dist/components/core/Accordion/Accordion.animations.js +15 -1
- package/dist/components/core/Accordion/Accordion.theme.js +5 -5
- package/dist/components/core/Accordion/Accordion.types.d.ts +25 -0
- package/dist/components/core/Accordion/AccordionContent.js +1 -1
- package/dist/components/core/Accordion/AccordionTrigger.js +11 -6
- package/dist/components/core/Alert/Alert.js +3 -2
- package/dist/components/core/Alert/Alert.theme.js +4 -8
- package/dist/components/core/Alert/Alert.types.d.ts +4 -3
- package/dist/components/core/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/AlertDialog/AlertDialog.types.d.ts +2 -2
- package/dist/components/core/Avatar/Avatar.theme.js +5 -5
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +1 -1
- package/dist/components/core/Badge/Badge.d.ts +1 -1
- package/dist/components/core/Badge/Badge.js +11 -9
- package/dist/components/core/Badge/Badge.theme.js +24 -20
- package/dist/components/core/Badge/Badge.types.d.ts +10 -5
- package/dist/components/core/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/core/Button/Button.d.ts +1 -1
- package/dist/components/core/Button/Button.js +21 -18
- package/dist/components/core/Button/Button.ripple.d.ts +5 -1
- package/dist/components/core/Button/Button.ripple.js +27 -17
- package/dist/components/core/Button/Button.theme.d.ts +1 -2
- package/dist/components/core/Button/Button.theme.js +46 -41
- package/dist/components/core/Button/Button.types.d.ts +3 -3
- package/dist/components/core/Button/index.d.ts +2 -0
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.js +1 -1
- package/dist/components/core/Calendar/Calendar.js +1 -1
- package/dist/components/core/Calendar/Calendar.theme.js +9 -9
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +1 -1
- package/dist/components/core/Card/Card.d.ts +2 -2
- package/dist/components/core/Card/Card.js +6 -7
- package/dist/components/core/Card/Card.theme.js +2 -2
- package/dist/components/core/Card/Card.types.d.ts +7 -27
- package/dist/components/core/Card/CardSubtitle.d.ts +3 -0
- package/dist/components/core/Card/CardSubtitle.js +11 -0
- package/dist/components/core/Card/CardTitle.d.ts +1 -1
- package/dist/components/core/Card/index.d.ts +2 -2
- package/dist/components/core/CommandPalette/CommandItem.d.ts +1 -1
- package/dist/components/core/CommandPalette/CommandItem.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +6 -6
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +3 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +1 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +3 -3
- package/dist/components/core/Drawer/Drawer.d.ts +13 -1
- package/dist/components/core/Drawer/Drawer.js +23 -10
- package/dist/components/core/Drawer/Drawer.theme.d.ts +2 -0
- package/dist/components/core/Drawer/Drawer.theme.js +15 -13
- package/dist/components/core/Drawer/Drawer.types.d.ts +26 -9
- package/dist/components/core/Drawer/DrawerContent.js +1 -1
- package/dist/components/core/Drawer/DrawerHeader.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerHeader.js +15 -0
- package/dist/components/core/Drawer/DrawerSubtitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerSubtitle.js +11 -0
- package/dist/components/core/Drawer/DrawerTitle.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerTitle.js +11 -0
- package/dist/components/core/Drawer/index.d.ts +1 -1
- package/dist/components/core/Dropdown/Dropdown.theme.js +1 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +4 -4
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownMenu.js +1 -0
- package/dist/components/core/Empty/Empty.js +2 -2
- package/dist/components/core/Empty/Empty.theme.d.ts +1 -1
- package/dist/components/core/Empty/Empty.theme.js +3 -3
- package/dist/components/core/Empty/Empty.types.d.ts +2 -2
- package/dist/components/core/Kbd/Kbd.theme.js +3 -3
- package/dist/components/core/Link/Link.d.ts +1 -1
- package/dist/components/core/Link/Link.types.d.ts +2 -2
- package/dist/components/core/Loader/Loader.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -2
- package/dist/components/core/MenuItem/MenuItem.theme.d.ts +1 -2
- package/dist/components/core/MenuItem/MenuItem.theme.js +9 -11
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +1 -1
- package/dist/components/core/Message/Message.d.ts +3 -2
- package/dist/components/core/Message/Message.js +30 -24
- package/dist/components/core/Message/Message.theme.d.ts +1 -1
- package/dist/components/core/Message/Message.theme.js +22 -24
- package/dist/components/core/Message/Message.types.d.ts +0 -7
- package/dist/components/core/Message/MessageList.animations.d.ts +6 -0
- package/dist/components/core/Message/MessageList.animations.js +32 -0
- package/dist/components/core/Message/MessageList.d.ts +5 -0
- package/dist/components/core/Message/MessageList.js +78 -0
- package/dist/components/core/Message/MessageList.theme.d.ts +2 -0
- package/dist/components/core/Message/MessageList.theme.js +6 -0
- package/dist/components/core/Message/MessageList.types.d.ts +32 -0
- package/dist/components/core/Message/index.d.ts +2 -0
- package/dist/components/core/Modal/Modal.d.ts +2 -2
- package/dist/components/core/Modal/Modal.js +5 -5
- package/dist/components/core/Modal/Modal.theme.js +6 -6
- package/dist/components/core/Modal/Modal.types.d.ts +4 -4
- package/dist/components/core/Modal/ModalHeader.js +1 -0
- package/dist/components/core/Modal/ModalSubtitle.d.ts +5 -0
- package/dist/components/core/Modal/ModalSubtitle.js +11 -0
- package/dist/components/core/ModalStack/ModalStack.animations.js +3 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -3
- package/dist/components/core/NavItem/NavItem.js +1 -1
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +3 -3
- package/dist/components/core/PageHeading/PageHeading.d.ts +8 -0
- package/dist/components/core/PageHeading/PageHeading.js +28 -0
- package/dist/components/core/PageHeading/PageHeading.theme.d.ts +2 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +11 -0
- package/dist/components/core/PageHeading/PageHeading.types.d.ts +55 -0
- package/dist/components/core/PageHeading/PageHeadingActions.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingActions.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +12 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingIcon.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingSubtitle.js +11 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.d.ts +3 -0
- package/dist/components/core/PageHeading/PageHeadingTitle.js +11 -0
- package/dist/components/core/PageHeading/index.d.ts +2 -0
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.theme.js +3 -3
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/Popover/Popover.types.d.ts +6 -0
- package/dist/components/core/Popover/PopoverContent.js +8 -2
- package/dist/components/core/Progress/Progress.theme.js +10 -7
- package/dist/components/core/Progress/Progress.types.d.ts +2 -1
- package/dist/components/core/Segmented/Segmented.theme.js +5 -5
- package/dist/components/core/Sidebar/Sidebar.js +1 -0
- package/dist/components/core/Sidebar/SidebarNavGroup.js +1 -1
- package/dist/components/core/SocialIcon/SocialIcon.d.ts +3 -0
- package/dist/components/core/SocialIcon/SocialIcon.js +30 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.d.ts +2 -0
- package/dist/components/core/SocialIcon/SocialIcon.theme.js +12 -0
- package/dist/components/core/SocialIcon/SocialIcon.types.d.ts +18 -0
- package/dist/components/core/SocialIcon/index.d.ts +2 -0
- package/dist/components/core/SocialIcon/platforms.d.ts +17 -0
- package/dist/components/core/SocialIcon/platforms.js +234 -0
- package/dist/components/core/Spinner/Spinner.theme.js +3 -5
- package/dist/components/core/Spinner/Spinner.types.d.ts +2 -1
- package/dist/components/core/Tabs/Tabs.theme.js +2 -2
- package/dist/components/core/Tag/Tag.d.ts +2 -2
- package/dist/components/core/Tag/Tag.js +21 -4
- package/dist/components/core/Tag/Tag.theme.js +12 -4
- package/dist/components/core/Tag/Tag.types.d.ts +24 -1
- package/dist/components/core/Toast/Toast.js +4 -4
- package/dist/components/core/Toast/Toast.theme.js +4 -4
- package/dist/components/core/Toast/Toast.types.d.ts +9 -9
- package/dist/components/core/Toast/useToast.js +6 -6
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +2 -7
- package/dist/components/core/index.js +10 -19
- package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +8 -0
- package/dist/components/{core → data-display}/Feed/Feed.js +3 -3
- package/dist/components/{core → data-display}/Feed/Feed.theme.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.animations.d.ts +4 -0
- package/dist/components/data-display/GanttChart/GanttChart.animations.js +21 -0
- package/dist/components/data-display/GanttChart/GanttChart.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttChart.js +170 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +23 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +162 -0
- package/dist/components/data-display/GanttChart/GanttChart.types.js +9 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.d.ts +80 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.js +274 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +82 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.js +35 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttGroupBar.js +26 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttMilestone.js +44 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttProgressCircle.js +11 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttSplitter.js +39 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +23 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttTableHeader.js +13 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.d.ts +6 -0
- package/dist/components/data-display/GanttChart/GanttTablePanel.js +20 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.js +30 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.d.ts +9 -0
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +206 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +17 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.d.ts +7 -0
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.js +33 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.d.ts +8 -0
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +43 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.d.ts +2 -0
- package/dist/components/data-display/GanttChart/GanttToolbar.js +29 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.d.ts +12 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDates.js +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.d.ts +25 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.js +144 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.d.ts +2 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttLayout.js +33 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.d.ts +6 -0
- package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.js +32 -0
- package/dist/components/data-display/GanttChart/index.d.ts +3 -0
- package/dist/components/{core → data-display}/KPI/KPI.js +10 -8
- package/dist/components/{core → data-display}/KPI/KPI.theme.js +12 -12
- package/dist/components/{core → data-display}/KPI/KPI.types.d.ts +6 -5
- package/dist/components/{core → data-display}/KPI/index.d.ts +1 -0
- package/dist/components/{core → data-display}/Metric/Metric.js +4 -7
- package/dist/components/{core → data-display}/Metric/Metric.theme.js +17 -13
- package/dist/components/{core → data-display}/Metric/Metric.types.d.ts +8 -7
- package/dist/components/{core → data-display}/Table/Table.theme.js +4 -4
- package/dist/components/{core → data-display}/Table/TableActions.js +8 -8
- package/dist/components/{core → data-display}/Table/TableActionsMenu.js +1 -1
- package/dist/components/{core → data-display}/Table/TableColumnManager.js +6 -5
- package/dist/components/{core → data-display}/Table/TableFilter.js +6 -6
- package/dist/components/{core → data-display}/Table/TableHeader.js +1 -1
- package/dist/components/data-display/Table/TablePagination.js +25 -0
- package/dist/components/{core → data-display}/Table/TableRow.js +1 -1
- package/dist/components/{core → data-display}/Table/TableSelectionHeader.js +3 -3
- package/dist/components/{core → data-display}/Timeline/Timeline.theme.js +2 -2
- package/dist/components/data-display/index.d.ts +7 -0
- package/dist/components/data-display/index.js +20 -0
- package/dist/components/effects/3d/index.d.ts +6 -0
- package/dist/components/effects/3d/index.js +3 -0
- package/dist/components/effects/Aurora/Aurora.d.ts +24 -0
- package/dist/components/effects/Aurora/Aurora.js +119 -0
- package/dist/components/effects/Aurora/Aurora.types.d.ts +15 -0
- package/dist/components/effects/Aurora/index.d.ts +2 -0
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +3 -1
- package/dist/components/effects/CustomCursor/CustomCursor.types.d.ts +5 -4
- package/dist/components/effects/DotPattern/DotPattern.d.ts +18 -0
- package/dist/components/effects/DotPattern/DotPattern.js +65 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +47 -0
- package/dist/components/effects/DotPattern/index.d.ts +2 -0
- package/dist/components/effects/GridPattern/GridPattern.d.ts +18 -0
- package/dist/components/effects/GridPattern/GridPattern.js +64 -0
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +47 -0
- package/dist/components/effects/GridPattern/index.d.ts +2 -0
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +30 -0
- package/dist/components/effects/MagneticElement/MagneticElement.js +110 -0
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +44 -0
- package/dist/components/effects/MagneticElement/index.d.ts +2 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +17 -0
- package/dist/components/effects/MorphingText/MorphingText.js +91 -0
- package/dist/components/effects/MorphingText/MorphingText.types.d.ts +18 -0
- package/dist/components/effects/MorphingText/index.d.ts +2 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.d.ts +28 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.js +61 -0
- package/dist/components/effects/NoiseOverlay/NoiseOverlay.types.d.ts +35 -0
- package/dist/components/effects/NoiseOverlay/index.d.ts +2 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +26 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.js +71 -0
- package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +11 -0
- package/dist/components/effects/ParallaxSection/index.d.ts +2 -0
- package/dist/components/effects/Particles/Particles.d.ts +22 -0
- package/dist/components/effects/Particles/Particles.js +33 -0
- package/dist/components/effects/Particles/Particles.scene.d.ts +3 -0
- package/dist/components/effects/Particles/Particles.scene.js +284 -0
- package/dist/components/effects/Particles/Particles.types.d.ts +65 -0
- package/dist/components/effects/Particles/index.d.ts +2 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.d.ts +3 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +75 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.d.ts +7 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.js +12 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +47 -0
- package/dist/components/effects/ProgressiveBlur/index.d.ts +2 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.d.ts +29 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.js +121 -0
- package/dist/components/effects/ScrollReveal/ScrollReveal.types.d.ts +25 -0
- package/dist/components/effects/ScrollReveal/index.d.ts +2 -0
- package/dist/components/effects/Spotlight/Spotlight.d.ts +36 -0
- package/dist/components/effects/Spotlight/Spotlight.js +112 -0
- package/dist/components/effects/Spotlight/Spotlight.types.d.ts +29 -0
- package/dist/components/effects/Spotlight/index.d.ts +2 -0
- package/dist/components/effects/StickyScroll/StickyScroll.d.ts +30 -0
- package/dist/components/effects/StickyScroll/StickyScroll.js +128 -0
- package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +19 -0
- package/dist/components/effects/StickyScroll/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +22 -4
- package/dist/components/effects/index.js +11 -2
- package/dist/components/forms/Checkbox/Checkbox.d.ts +3 -4
- package/dist/components/forms/Checkbox/Checkbox.js +36 -12
- package/dist/components/forms/Checkbox/Checkbox.theme.js +9 -5
- package/dist/components/forms/Checkbox/Checkbox.types.d.ts +28 -2
- package/dist/components/forms/Checkbox/CheckboxContext.d.ts +14 -0
- package/dist/components/forms/Checkbox/CheckboxContext.js +12 -0
- package/dist/components/forms/Checkbox/CheckboxGroup.d.ts +3 -0
- package/dist/components/forms/Checkbox/CheckboxGroup.js +40 -0
- package/dist/components/forms/Checkbox/index.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +7 -7
- package/dist/components/forms/CronInput/CronInput.d.ts +3 -0
- package/dist/components/forms/CronInput/CronInput.js +107 -0
- package/dist/components/forms/CronInput/CronInput.theme.d.ts +6 -0
- package/dist/components/forms/CronInput/CronInput.theme.js +84 -0
- package/dist/components/forms/CronInput/CronInput.types.d.ts +98 -0
- package/dist/components/forms/CronInput/CronInput.utils.d.ts +67 -0
- package/dist/components/forms/CronInput/CronInput.utils.js +505 -0
- package/dist/components/forms/CronInput/index.d.ts +4 -0
- package/dist/components/forms/DatePicker/DatePicker.theme.js +3 -3
- package/dist/components/forms/DatePicker/DatePickerContent.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.js +80 -2
- package/dist/components/forms/FileUpload/FileUpload.theme.js +4 -4
- package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
- package/dist/components/forms/Input/Input.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.d.ts +1 -1
- package/dist/components/forms/InputCounter/InputCounter.theme.js +1 -1
- package/dist/components/forms/InputCounter/InputCounter.types.d.ts +3 -2
- package/dist/components/forms/InputOTP/InputOTP.theme.js +2 -2
- package/dist/components/forms/InputTag/InputTag.js +1 -1
- package/dist/components/forms/Mention/Mention.d.ts +3 -0
- package/dist/components/forms/Mention/Mention.js +607 -0
- package/dist/components/forms/Mention/Mention.theme.d.ts +6 -0
- package/dist/components/forms/Mention/Mention.theme.js +55 -0
- package/dist/components/forms/Mention/Mention.types.d.ts +151 -0
- package/dist/components/forms/Mention/Mention.utils.d.ts +42 -0
- package/dist/components/forms/Mention/Mention.utils.js +285 -0
- package/dist/components/forms/Mention/index.d.ts +3 -0
- package/dist/components/forms/Radio/Radio.d.ts +3 -4
- package/dist/components/forms/Radio/Radio.js +25 -12
- package/dist/components/forms/Radio/Radio.theme.js +34 -5
- package/dist/components/forms/Radio/Radio.types.d.ts +30 -4
- package/dist/components/forms/Radio/RadioContext.d.ts +14 -0
- package/dist/components/forms/Radio/RadioContext.js +12 -0
- package/dist/components/forms/Radio/RadioGroup.d.ts +3 -0
- package/dist/components/forms/Radio/RadioGroup.js +36 -0
- package/dist/components/forms/Radio/index.d.ts +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +1 -1
- package/dist/components/forms/Select/Select.theme.js +1 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +9 -0
- package/dist/components/forms/SelectableCard/SelectableCard.d.ts +5 -0
- package/dist/components/forms/SelectableCard/SelectableCard.js +58 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.d.ts +2 -0
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +38 -0
- package/dist/components/forms/SelectableCard/SelectableCard.types.d.ts +33 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.js +12 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.d.ts +3 -0
- package/dist/components/forms/SelectableCard/SelectableCardGroup.js +37 -0
- package/dist/components/forms/SelectableCard/index.d.ts +3 -0
- package/dist/components/forms/Signature/Signature.theme.js +1 -1
- package/dist/components/forms/Slider/Slider.theme.js +3 -3
- package/dist/components/forms/Switch/Switch.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +2 -2
- package/dist/components/forms/TimePicker/TimePickerContent.js +78 -1
- package/dist/components/forms/TransferList/TransferList.animations.d.ts +10 -0
- package/dist/components/forms/TransferList/TransferList.animations.js +32 -0
- package/dist/components/forms/TransferList/TransferList.d.ts +28 -0
- package/dist/components/forms/TransferList/TransferList.js +199 -0
- package/dist/components/forms/TransferList/TransferList.theme.d.ts +6 -0
- package/dist/components/forms/TransferList/TransferList.theme.js +60 -0
- package/dist/components/forms/TransferList/TransferList.types.d.ts +101 -0
- package/dist/components/forms/TransferList/index.d.ts +3 -0
- package/dist/components/forms/forms.theme.js +6 -6
- package/dist/components/forms/index.d.ts +15 -2
- package/dist/components/forms/index.js +87 -0
- package/dist/components/layout/FormLayout/FormLayout.d.ts +8 -0
- package/dist/components/layout/FormLayout/FormLayout.js +22 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.d.ts +2 -0
- package/dist/components/layout/FormLayout/FormLayout.theme.js +16 -0
- package/dist/components/layout/FormLayout/FormLayout.types.d.ts +61 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutBody.js +91 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutFooter.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutHeader.js +12 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayoutSection.js +12 -0
- package/dist/components/layout/FormLayout/index.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayout.d.ts +7 -0
- package/dist/components/layout/PageLayout/PageLayout.js +33 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.d.ts +2 -0
- package/dist/components/layout/PageLayout/PageLayout.theme.js +10 -0
- package/dist/components/layout/PageLayout/PageLayout.types.d.ts +39 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutHeader.js +12 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.d.ts +3 -0
- package/dist/components/layout/PageLayout/PageLayoutSidebar.js +12 -0
- package/dist/components/layout/PageLayout/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/hooks/useSelectPortal.d.ts +4 -2
- package/dist/hooks/useSelectPortal.js +139 -51
- package/dist/index.d.ts +2 -0
- package/dist/index.js +206 -167
- package/dist/styles.css +1 -1
- package/dist/utils/colorUtils.d.ts +23 -0
- package/dist/utils/colorUtils.js +45 -0
- package/dist/utils/dateUtils.d.ts +30 -0
- package/dist/utils/dateUtils.js +58 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +38 -26
- package/src/global.scss +673 -0
- package/src/styles/theme.css +378 -0
- package/src/theme-plugin.css +11 -0
- package/dist/components/core/Button/Button.animations.d.ts +0 -5
- package/dist/components/core/Card/CardDescription.d.ts +0 -3
- package/dist/components/core/Card/CardDescription.js +0 -11
- package/dist/components/core/DescriptionList/DescriptionList.theme.js +0 -8
- package/dist/components/core/Modal/ModalDescription.d.ts +0 -5
- package/dist/components/core/Modal/ModalDescription.js +0 -11
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.d.ts +0 -34
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.js +0 -218
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.theme.d.ts +0 -9
- package/dist/components/core/ProgressiveBlur/ProgressiveBlur.types.d.ts +0 -48
- package/dist/components/core/ProgressiveBlur/index.d.ts +0 -2
- package/dist/components/core/Table/TablePagination.js +0 -25
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.js +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/DescriptionList/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/Feed.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Feed/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.d.ts +0 -0
- /package/dist/components/{core → data-display}/KPI/KPI.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/Metric.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Metric/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.animations.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.filterUtils.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.js +0 -0
- /package/dist/components/{core → data-display}/Table/Table.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/Table.utils.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableActions.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableActionsMenu.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableBody.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableCell.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableColumnManager.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableDeclarative.js +0 -0
- /package/dist/components/{core → data-display}/Table/TableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableRow.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/TableSelectionHeader.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.js +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.js +0 -0
- /package/dist/components/{core → data-display}/Table/index.d.ts +0 -0
- /package/dist/components/{core → data-display}/Table/index.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.animations.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.theme.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/Timeline.types.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineContent.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineItem.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.d.ts +0 -0
- /package/dist/components/{core → data-display}/Timeline/TimelineMarker.js +0 -0
- /package/dist/components/{core → data-display}/Timeline/index.d.ts +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface GanttTask {
|
|
3
|
+
id: string;
|
|
4
|
+
groupId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
startDate: Date | string;
|
|
7
|
+
endDate: Date | string;
|
|
8
|
+
progress: number;
|
|
9
|
+
assignee?: {
|
|
10
|
+
name: string;
|
|
11
|
+
avatar?: string;
|
|
12
|
+
};
|
|
13
|
+
color?: string;
|
|
14
|
+
completed?: boolean;
|
|
15
|
+
dependencies?: string[];
|
|
16
|
+
milestone?: boolean;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
export interface GanttHoliday {
|
|
20
|
+
date: Date | string;
|
|
21
|
+
label: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface GanttGroup {
|
|
25
|
+
id: string;
|
|
26
|
+
title: string;
|
|
27
|
+
color: string;
|
|
28
|
+
order?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface GanttColumn<T extends GanttTask = GanttTask> {
|
|
31
|
+
id: string;
|
|
32
|
+
header: string;
|
|
33
|
+
accessor: keyof T | ((task: T) => any);
|
|
34
|
+
cell?: (task: T, group: GanttGroup) => ReactNode;
|
|
35
|
+
width?: number;
|
|
36
|
+
align?: "left" | "center" | "right";
|
|
37
|
+
}
|
|
38
|
+
export interface GanttDragState {
|
|
39
|
+
taskId: string;
|
|
40
|
+
mode: "move" | "resize-left" | "resize-right";
|
|
41
|
+
deltaX: number;
|
|
42
|
+
}
|
|
43
|
+
export type GanttZoom = "day" | "week" | "quarter" | "month" | "year";
|
|
44
|
+
export declare const DAY_WIDTHS: Record<GanttZoom, number>;
|
|
45
|
+
export type GanttRowType = "group" | "task";
|
|
46
|
+
export interface GanttGroupRow {
|
|
47
|
+
type: "group";
|
|
48
|
+
group: GanttGroup;
|
|
49
|
+
taskCount: number;
|
|
50
|
+
completedCount: number;
|
|
51
|
+
earliestStart: Date;
|
|
52
|
+
latestEnd: Date;
|
|
53
|
+
}
|
|
54
|
+
export interface GanttTaskRow {
|
|
55
|
+
type: "task";
|
|
56
|
+
task: GanttTask;
|
|
57
|
+
group: GanttGroup;
|
|
58
|
+
}
|
|
59
|
+
export type GanttRow = GanttGroupRow | GanttTaskRow;
|
|
60
|
+
export interface GanttChartThemeOverrides {
|
|
61
|
+
baseStyle?: string;
|
|
62
|
+
toolbarStyle?: string;
|
|
63
|
+
tablePanelStyle?: string;
|
|
64
|
+
chartPanelStyle?: string;
|
|
65
|
+
tableHeaderStyle?: string;
|
|
66
|
+
tableHeaderCellStyle?: string;
|
|
67
|
+
tableGroupRowStyle?: string;
|
|
68
|
+
tableTaskRowStyle?: string;
|
|
69
|
+
tableCellStyle?: string;
|
|
70
|
+
timelineHeaderStyle?: string;
|
|
71
|
+
timelineMonthStyle?: string;
|
|
72
|
+
timelineDayStyle?: string;
|
|
73
|
+
gridLineStyle?: string;
|
|
74
|
+
weekendStyle?: string;
|
|
75
|
+
todayMarkerStyle?: string;
|
|
76
|
+
todayColumnStyle?: string;
|
|
77
|
+
taskBarStyle?: string;
|
|
78
|
+
groupBarStyle?: string;
|
|
79
|
+
splitterStyle?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface GanttContextValue {
|
|
82
|
+
groups: GanttGroup[];
|
|
83
|
+
tasks: GanttTask[];
|
|
84
|
+
columns: GanttColumn[];
|
|
85
|
+
rows: GanttRow[];
|
|
86
|
+
rangeStart: Date;
|
|
87
|
+
rangeEnd: Date;
|
|
88
|
+
totalDays: number;
|
|
89
|
+
dayWidth: number;
|
|
90
|
+
zoom: GanttZoom;
|
|
91
|
+
collapsedGroups: string[];
|
|
92
|
+
hideCompleted: boolean;
|
|
93
|
+
tablePanelWidth: number;
|
|
94
|
+
readonly: boolean;
|
|
95
|
+
readonlyDates: boolean;
|
|
96
|
+
readonlyProgress: boolean;
|
|
97
|
+
onTaskUpdate?: (taskId: string, updates: Partial<GanttTask>) => void;
|
|
98
|
+
onTaskDelete?: (taskId: string) => void;
|
|
99
|
+
onTaskDuplicate?: (taskId: string) => void;
|
|
100
|
+
onTaskAdd?: (groupId: string) => void;
|
|
101
|
+
onGroupAdd?: () => void;
|
|
102
|
+
onTaskClick?: (task: GanttTask, event: React.MouseEvent) => void;
|
|
103
|
+
toggleGroup: (groupId: string) => void;
|
|
104
|
+
setZoom: (zoom: GanttZoom) => void;
|
|
105
|
+
setHideCompleted: (hide: boolean) => void;
|
|
106
|
+
setTablePanelWidth: (width: number) => void;
|
|
107
|
+
theme: GanttChartThemeOverrides;
|
|
108
|
+
todayMarker: boolean;
|
|
109
|
+
todayOffset: number | null;
|
|
110
|
+
scrollToToday: boolean;
|
|
111
|
+
holidays: GanttHoliday[];
|
|
112
|
+
gridLines: "both" | "vertical" | "horizontal" | "none";
|
|
113
|
+
rowHeight: number;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Frequently-changing interaction state is separated into its own context
|
|
117
|
+
* so that stable consumers (toolbar, grid, table header) don't re-render
|
|
118
|
+
* on hover/focus/drag changes.
|
|
119
|
+
*/
|
|
120
|
+
export interface GanttInteractionValue {
|
|
121
|
+
hoveredTaskId: string | null;
|
|
122
|
+
setHoveredTaskId: (id: string | null) => void;
|
|
123
|
+
focusedTaskId: string | null;
|
|
124
|
+
setFocusedTaskId: (id: string | null) => void;
|
|
125
|
+
activeDrag: GanttDragState | null;
|
|
126
|
+
setActiveDrag: (state: GanttDragState | null) => void;
|
|
127
|
+
}
|
|
128
|
+
export interface GanttChartProps {
|
|
129
|
+
data: GanttTask[];
|
|
130
|
+
groups: GanttGroup[];
|
|
131
|
+
columns?: GanttColumn[];
|
|
132
|
+
startDate?: Date | string;
|
|
133
|
+
endDate?: Date | string;
|
|
134
|
+
todayMarker?: boolean;
|
|
135
|
+
scrollToToday?: boolean;
|
|
136
|
+
readonly?: boolean;
|
|
137
|
+
readonlyDates?: boolean;
|
|
138
|
+
readonlyProgress?: boolean;
|
|
139
|
+
zoom?: GanttZoom;
|
|
140
|
+
defaultZoom?: GanttZoom;
|
|
141
|
+
onZoomChange?: (zoom: GanttZoom) => void;
|
|
142
|
+
collapsedGroups?: string[];
|
|
143
|
+
defaultCollapsedGroups?: string[];
|
|
144
|
+
onCollapsedGroupsChange?: (groups: string[]) => void;
|
|
145
|
+
hideCompleted?: boolean;
|
|
146
|
+
defaultHideCompleted?: boolean;
|
|
147
|
+
onHideCompletedChange?: (hide: boolean) => void;
|
|
148
|
+
tablePanelWidth?: number;
|
|
149
|
+
defaultTablePanelWidth?: number;
|
|
150
|
+
onTablePanelWidthChange?: (width: number) => void;
|
|
151
|
+
onTaskUpdate?: (taskId: string, updates: Partial<GanttTask>) => void;
|
|
152
|
+
onTaskDelete?: (taskId: string) => void;
|
|
153
|
+
onTaskDuplicate?: (taskId: string) => void;
|
|
154
|
+
onTaskAdd?: (groupId: string) => void;
|
|
155
|
+
onGroupAdd?: () => void;
|
|
156
|
+
onTaskClick?: (task: GanttTask, event: React.MouseEvent) => void;
|
|
157
|
+
holidays?: GanttHoliday[];
|
|
158
|
+
gridLines?: "both" | "vertical" | "horizontal" | "none";
|
|
159
|
+
className?: string;
|
|
160
|
+
theme?: GanttChartThemeOverrides;
|
|
161
|
+
rowHeight?: number;
|
|
162
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { GanttTask, GanttGroup, GanttRow, GanttDragState } from "./GanttChart.types";
|
|
2
|
+
export { toDate, addDays, isSameDay, isWeekend, getDaysBetween, getWeekNumber, } from "../../../utils/dateUtils";
|
|
3
|
+
/**
|
|
4
|
+
* Day-offset of `date` from `rangeStart` (0-based).
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDayOffset(date: Date | string, rangeStart: Date | string): number;
|
|
7
|
+
/**
|
|
8
|
+
* Generate every date between rangeStart and rangeEnd (inclusive).
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateDayColumns(rangeStart: Date, rangeEnd: Date): Date[];
|
|
11
|
+
/**
|
|
12
|
+
* Group consecutive days into month spans.
|
|
13
|
+
* Returns [{month: "Jan 2024", startIndex: 0, span: 31}, …]
|
|
14
|
+
*/
|
|
15
|
+
export interface MonthSpan {
|
|
16
|
+
label: string;
|
|
17
|
+
startIndex: number;
|
|
18
|
+
span: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function generateMonthSpans(days: Date[]): MonthSpan[];
|
|
21
|
+
/**
|
|
22
|
+
* Auto-detect date range from task data with padding.
|
|
23
|
+
*/
|
|
24
|
+
export declare function autoDateRange(tasks: GanttTask[], paddingDays?: number): {
|
|
25
|
+
start: Date;
|
|
26
|
+
end: Date;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Compute group summary: earliest start, latest end, completed count.
|
|
30
|
+
*/
|
|
31
|
+
export declare function computeGroupSummary(group: GanttGroup, tasks: GanttTask[]): {
|
|
32
|
+
earliestStart: Date;
|
|
33
|
+
latestEnd: Date;
|
|
34
|
+
completedCount: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Format a short day label (e.g. "15", "Mon 15").
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatDayLabel(date: Date, zoom: "day" | "week" | "quarter" | "month" | "year"): string;
|
|
40
|
+
/**
|
|
41
|
+
* Format duration as "X days".
|
|
42
|
+
*/
|
|
43
|
+
export declare function formatDuration(startDate: Date | string, endDate: Date | string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Format a date as "Jan 15" style short label.
|
|
46
|
+
*/
|
|
47
|
+
export declare function formatDateShort(date: Date | string): string;
|
|
48
|
+
export interface WeekSpan {
|
|
49
|
+
label: string;
|
|
50
|
+
startIndex: number;
|
|
51
|
+
span: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Group consecutive days into week spans with "W3" style labels.
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateWeekSpans(days: Date[]): WeekSpan[];
|
|
57
|
+
export interface ArrowPath {
|
|
58
|
+
id: string;
|
|
59
|
+
d: string;
|
|
60
|
+
isBackward: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Calculate an SVG path string for a dependency arrow from one task bar to another.
|
|
64
|
+
*
|
|
65
|
+
* Two routing modes:
|
|
66
|
+
* - Forward: target left >= source right + minGap → clean L-shaped path through midpoint
|
|
67
|
+
* - Overlap/backward: bars overlap horizontally → route below both bars
|
|
68
|
+
*/
|
|
69
|
+
export declare function calculateDependencyPath(fromLeft: number, fromWidth: number, fromTop: number, fromHeight: number, toLeft: number, toTop: number, toHeight: number): {
|
|
70
|
+
d: string;
|
|
71
|
+
isBackward: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Build all dependency arrow paths for visible tasks.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildDependencyArrows(tasks: GanttTask[], rows: GanttRow[], dayWidth: number, rowHeight: number, rangeStart: Date, activeDrag?: GanttDragState | null): ArrowPath[];
|
|
77
|
+
/**
|
|
78
|
+
* Calculate expected progress (0-100) based on elapsed time.
|
|
79
|
+
*/
|
|
80
|
+
export declare function calculateExpectedProgress(startDate: Date | string, endDate: Date | string): number;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { toDate, getDaysBetween } from '../../../utils/dateUtils.js';
|
|
2
|
+
export { addDays, isSameDay, isWeekend } from '../../../utils/dateUtils.js';
|
|
3
|
+
|
|
4
|
+
// Re-export generic date utilities from shared utils so existing consumers
|
|
5
|
+
// that import from "GanttChart.utils" continue to work.
|
|
6
|
+
/**
|
|
7
|
+
* Day-offset of `date` from `rangeStart` (0-based).
|
|
8
|
+
*/
|
|
9
|
+
function getDayOffset(date, rangeStart) {
|
|
10
|
+
return Math.round((toDate(date).getTime() - toDate(rangeStart).getTime()) / 86400000);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Generate every date between rangeStart and rangeEnd (inclusive).
|
|
14
|
+
*/
|
|
15
|
+
function generateDayColumns(rangeStart, rangeEnd) {
|
|
16
|
+
const days = [];
|
|
17
|
+
const current = new Date(rangeStart);
|
|
18
|
+
current.setHours(0, 0, 0, 0);
|
|
19
|
+
const end = new Date(rangeEnd);
|
|
20
|
+
end.setHours(0, 0, 0, 0);
|
|
21
|
+
while (current <= end) {
|
|
22
|
+
days.push(new Date(current));
|
|
23
|
+
current.setDate(current.getDate() + 1);
|
|
24
|
+
}
|
|
25
|
+
return days;
|
|
26
|
+
}
|
|
27
|
+
function generateMonthSpans(days) {
|
|
28
|
+
if (days.length === 0)
|
|
29
|
+
return [];
|
|
30
|
+
const spans = [];
|
|
31
|
+
let currentLabel = formatMonthLabel(days[0]);
|
|
32
|
+
let startIndex = 0;
|
|
33
|
+
for (let i = 1; i < days.length; i++) {
|
|
34
|
+
const label = formatMonthLabel(days[i]);
|
|
35
|
+
if (label !== currentLabel) {
|
|
36
|
+
spans.push({ label: currentLabel, startIndex, span: i - startIndex });
|
|
37
|
+
currentLabel = label;
|
|
38
|
+
startIndex = i;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
spans.push({
|
|
42
|
+
label: currentLabel,
|
|
43
|
+
startIndex,
|
|
44
|
+
span: days.length - startIndex,
|
|
45
|
+
});
|
|
46
|
+
return spans;
|
|
47
|
+
}
|
|
48
|
+
function formatMonthLabel(date) {
|
|
49
|
+
return date.toLocaleDateString("en-US", { month: "short", year: "numeric" });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Auto-detect date range from task data with padding.
|
|
53
|
+
*/
|
|
54
|
+
function autoDateRange(tasks, paddingDays = 7) {
|
|
55
|
+
if (tasks.length === 0) {
|
|
56
|
+
const now = new Date();
|
|
57
|
+
now.setHours(0, 0, 0, 0);
|
|
58
|
+
const end = new Date(now);
|
|
59
|
+
end.setDate(end.getDate() + 30);
|
|
60
|
+
return { start: now, end };
|
|
61
|
+
}
|
|
62
|
+
let min = Infinity;
|
|
63
|
+
let max = -Infinity;
|
|
64
|
+
for (const t of tasks) {
|
|
65
|
+
const s = toDate(t.startDate).getTime();
|
|
66
|
+
const e = toDate(t.endDate).getTime();
|
|
67
|
+
if (s < min)
|
|
68
|
+
min = s;
|
|
69
|
+
if (e > max)
|
|
70
|
+
max = e;
|
|
71
|
+
}
|
|
72
|
+
const start = new Date(min);
|
|
73
|
+
start.setDate(start.getDate() - paddingDays);
|
|
74
|
+
start.setHours(0, 0, 0, 0);
|
|
75
|
+
const end = new Date(max);
|
|
76
|
+
end.setDate(end.getDate() + paddingDays);
|
|
77
|
+
end.setHours(0, 0, 0, 0);
|
|
78
|
+
return { start, end };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Compute group summary: earliest start, latest end, completed count.
|
|
82
|
+
*/
|
|
83
|
+
function computeGroupSummary(group, tasks) {
|
|
84
|
+
const groupTasks = tasks.filter((t) => t.groupId === group.id);
|
|
85
|
+
if (groupTasks.length === 0) {
|
|
86
|
+
const now = new Date();
|
|
87
|
+
return { earliestStart: now, latestEnd: now, completedCount: 0 };
|
|
88
|
+
}
|
|
89
|
+
let earliest = Infinity;
|
|
90
|
+
let latest = -Infinity;
|
|
91
|
+
let completed = 0;
|
|
92
|
+
for (const t of groupTasks) {
|
|
93
|
+
const s = toDate(t.startDate).getTime();
|
|
94
|
+
const e = toDate(t.endDate).getTime();
|
|
95
|
+
if (s < earliest)
|
|
96
|
+
earliest = s;
|
|
97
|
+
if (e > latest)
|
|
98
|
+
latest = e;
|
|
99
|
+
if (t.completed)
|
|
100
|
+
completed++;
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
earliestStart: new Date(earliest),
|
|
104
|
+
latestEnd: new Date(latest),
|
|
105
|
+
completedCount: completed,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Format a short day label (e.g. "15", "Mon 15").
|
|
110
|
+
*/
|
|
111
|
+
function formatDayLabel(date, zoom) {
|
|
112
|
+
if (zoom === "day") {
|
|
113
|
+
const weekday = date.toLocaleDateString("en-US", { weekday: "short" });
|
|
114
|
+
return `${weekday} ${date.getDate()}`;
|
|
115
|
+
}
|
|
116
|
+
if (zoom === "year") {
|
|
117
|
+
return date.getDate() === 1
|
|
118
|
+
? date.toLocaleDateString("en-US", { month: "short" })
|
|
119
|
+
: "";
|
|
120
|
+
}
|
|
121
|
+
return `${date.getDate()}`;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Format duration as "X days".
|
|
125
|
+
*/
|
|
126
|
+
function formatDuration(startDate, endDate) {
|
|
127
|
+
const days = getDaysBetween(startDate, endDate);
|
|
128
|
+
return `${days}d`;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Format a date as "Jan 15" style short label.
|
|
132
|
+
*/
|
|
133
|
+
function formatDateShort(date) {
|
|
134
|
+
const d = toDate(date);
|
|
135
|
+
return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Calculate an SVG path string for a dependency arrow from one task bar to another.
|
|
139
|
+
*
|
|
140
|
+
* Two routing modes:
|
|
141
|
+
* - Forward: target left >= source right + minGap → clean L-shaped path through midpoint
|
|
142
|
+
* - Overlap/backward: bars overlap horizontally → route below both bars
|
|
143
|
+
*/
|
|
144
|
+
function calculateDependencyPath(fromLeft, fromWidth, fromTop, fromHeight, toLeft, toTop, toHeight) {
|
|
145
|
+
const startX = fromLeft + fromWidth;
|
|
146
|
+
const startY = fromTop + fromHeight / 2;
|
|
147
|
+
const endX = toLeft;
|
|
148
|
+
const endY = toTop + toHeight / 2;
|
|
149
|
+
const minGap = 24;
|
|
150
|
+
// Forward: enough horizontal space for a clean L-path
|
|
151
|
+
if (endX >= startX + minGap) {
|
|
152
|
+
if (Math.abs(endY - startY) < 1) {
|
|
153
|
+
// Same row — straight line
|
|
154
|
+
return { d: `M ${startX} ${startY} H ${endX}`, isBackward: false };
|
|
155
|
+
}
|
|
156
|
+
const midX = startX + (endX - startX) / 2;
|
|
157
|
+
const r = Math.min(5, Math.abs(endY - startY) / 2, (endX - startX) / 4);
|
|
158
|
+
const goDown = endY > startY;
|
|
159
|
+
const d = [
|
|
160
|
+
`M ${startX} ${startY}`,
|
|
161
|
+
`H ${midX - r}`,
|
|
162
|
+
`Q ${midX} ${startY} ${midX} ${startY + (goDown ? r : -r)}`,
|
|
163
|
+
`V ${endY + (goDown ? -r : r)}`,
|
|
164
|
+
`Q ${midX} ${endY} ${midX + r} ${endY}`,
|
|
165
|
+
`H ${endX}`,
|
|
166
|
+
].join(" ");
|
|
167
|
+
return { d, isBackward: false };
|
|
168
|
+
}
|
|
169
|
+
// Overlap or close proximity: route below both bars
|
|
170
|
+
const gap = 14;
|
|
171
|
+
const exitX = startX + gap;
|
|
172
|
+
const entryX = endX - gap;
|
|
173
|
+
// Go below the lower of the two bars so we never cross through them
|
|
174
|
+
const lowerBottom = Math.max(fromTop + fromHeight, toTop + toHeight);
|
|
175
|
+
const routeY = lowerBottom + gap;
|
|
176
|
+
const d = [
|
|
177
|
+
`M ${startX} ${startY}`,
|
|
178
|
+
`H ${exitX}`,
|
|
179
|
+
`V ${routeY}`,
|
|
180
|
+
`H ${entryX}`,
|
|
181
|
+
`V ${endY}`,
|
|
182
|
+
`H ${endX}`,
|
|
183
|
+
].join(" ");
|
|
184
|
+
// Only visually mark as backward (dashed) if target truly starts before source
|
|
185
|
+
return { d, isBackward: endX < fromLeft };
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Build all dependency arrow paths for visible tasks.
|
|
189
|
+
*/
|
|
190
|
+
function buildDependencyArrows(tasks, rows, dayWidth, rowHeight, rangeStart, activeDrag) {
|
|
191
|
+
var _a;
|
|
192
|
+
const taskMap = new Map(tasks.map((t) => [t.id, t]));
|
|
193
|
+
const rowIndexMap = new Map();
|
|
194
|
+
rows.forEach((row, i) => {
|
|
195
|
+
if (row.type === "task")
|
|
196
|
+
rowIndexMap.set(row.task.id, i);
|
|
197
|
+
});
|
|
198
|
+
const arrows = [];
|
|
199
|
+
const barHeight = rowHeight - 12;
|
|
200
|
+
for (const task of tasks) {
|
|
201
|
+
if (!((_a = task.dependencies) === null || _a === void 0 ? void 0 : _a.length))
|
|
202
|
+
continue;
|
|
203
|
+
const toIdx = rowIndexMap.get(task.id);
|
|
204
|
+
if (toIdx === undefined)
|
|
205
|
+
continue;
|
|
206
|
+
for (const depId of task.dependencies) {
|
|
207
|
+
const dep = taskMap.get(depId);
|
|
208
|
+
if (!dep)
|
|
209
|
+
continue;
|
|
210
|
+
const fromIdx = rowIndexMap.get(depId);
|
|
211
|
+
if (fromIdx === undefined)
|
|
212
|
+
continue;
|
|
213
|
+
const fromOffset = getDayOffset(dep.startDate, rangeStart);
|
|
214
|
+
const fromSpan = getDaysBetween(dep.startDate, dep.endDate);
|
|
215
|
+
let fromLeft = fromOffset * dayWidth;
|
|
216
|
+
let fromWidth = Math.max(fromSpan * dayWidth, dayWidth);
|
|
217
|
+
const fromTop = fromIdx * rowHeight + (rowHeight - barHeight) / 2;
|
|
218
|
+
const toOffset = getDayOffset(task.startDate, rangeStart);
|
|
219
|
+
let toLeft = toOffset * dayWidth;
|
|
220
|
+
const toTop = toIdx * rowHeight + (rowHeight - barHeight) / 2;
|
|
221
|
+
// Apply drag offsets for real-time arrow following
|
|
222
|
+
if (activeDrag) {
|
|
223
|
+
// Source task (dep) is being dragged
|
|
224
|
+
if (activeDrag.taskId === depId) {
|
|
225
|
+
if (activeDrag.mode === "move") {
|
|
226
|
+
fromLeft += activeDrag.deltaX;
|
|
227
|
+
}
|
|
228
|
+
else if (activeDrag.mode === "resize-left") {
|
|
229
|
+
fromLeft += activeDrag.deltaX;
|
|
230
|
+
fromWidth -= activeDrag.deltaX;
|
|
231
|
+
}
|
|
232
|
+
else if (activeDrag.mode === "resize-right") {
|
|
233
|
+
fromWidth += activeDrag.deltaX;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// Target task is being dragged
|
|
237
|
+
if (activeDrag.taskId === task.id) {
|
|
238
|
+
if (activeDrag.mode === "move") {
|
|
239
|
+
toLeft += activeDrag.deltaX;
|
|
240
|
+
}
|
|
241
|
+
else if (activeDrag.mode === "resize-left") {
|
|
242
|
+
toLeft += activeDrag.deltaX;
|
|
243
|
+
}
|
|
244
|
+
// resize-right doesn't move the left edge (target start)
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
const result = calculateDependencyPath(fromLeft, fromWidth, fromTop, barHeight, toLeft, toTop, barHeight);
|
|
248
|
+
arrows.push({
|
|
249
|
+
id: `${depId}->${task.id}`,
|
|
250
|
+
d: result.d,
|
|
251
|
+
isBackward: result.isBackward,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return arrows;
|
|
256
|
+
}
|
|
257
|
+
// ---------------------------------------------------------------------------
|
|
258
|
+
// Expected progress
|
|
259
|
+
// ---------------------------------------------------------------------------
|
|
260
|
+
/**
|
|
261
|
+
* Calculate expected progress (0-100) based on elapsed time.
|
|
262
|
+
*/
|
|
263
|
+
function calculateExpectedProgress(startDate, endDate) {
|
|
264
|
+
const start = toDate(startDate).getTime();
|
|
265
|
+
const end = toDate(endDate).getTime();
|
|
266
|
+
const now = new Date().setHours(0, 0, 0, 0);
|
|
267
|
+
if (now <= start)
|
|
268
|
+
return 0;
|
|
269
|
+
if (now >= end)
|
|
270
|
+
return 100;
|
|
271
|
+
return Math.round(((now - start) / (end - start)) * 100);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export { autoDateRange, buildDependencyArrows, calculateDependencyPath, calculateExpectedProgress, computeGroupSummary, formatDateShort, formatDayLabel, formatDuration, generateDayColumns, generateMonthSpans, getDayOffset, getDaysBetween, toDate };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { MonthSpan } from "./GanttChart.utils";
|
|
3
|
+
interface GanttChartPanelProps {
|
|
4
|
+
onScroll: () => void;
|
|
5
|
+
days: Date[];
|
|
6
|
+
monthSpans: MonthSpan[];
|
|
7
|
+
}
|
|
8
|
+
export declare const GanttChartPanel: React.ForwardRefExoticComponent<GanttChartPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useEffect, useCallback } from 'react';
|
|
3
|
+
import { CalendarDaysIcon } from '@heroicons/react/24/outline';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
import { useGanttContext, useGanttInteraction } from './GanttChart.js';
|
|
6
|
+
import { GanttTimelineHeader } from './GanttTimelineHeader.js';
|
|
7
|
+
import { GanttTimelineGrid } from './GanttTimelineGrid.js';
|
|
8
|
+
import { GanttDependencyArrows } from './GanttDependencyArrows.js';
|
|
9
|
+
import { GanttTaskBar } from './GanttTaskBar.js';
|
|
10
|
+
import { GanttGroupBar } from './GanttGroupBar.js';
|
|
11
|
+
import { GanttMilestone } from './GanttMilestone.js';
|
|
12
|
+
|
|
13
|
+
const GanttChartPanel = forwardRef(({ onScroll, days, monthSpans }, ref) => {
|
|
14
|
+
const { theme, rows, tasks, dayWidth, rowHeight, todayOffset, scrollToToday, onTaskClick, } = useGanttContext();
|
|
15
|
+
const { focusedTaskId, setFocusedTaskId } = useGanttInteraction();
|
|
16
|
+
const totalWidth = days.length * dayWidth;
|
|
17
|
+
const bodyHeight = rows.length * rowHeight;
|
|
18
|
+
// Auto-scroll to today on mount
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!scrollToToday || todayOffset === null)
|
|
21
|
+
return;
|
|
22
|
+
if (!ref || !("current" in ref) || !ref.current)
|
|
23
|
+
return;
|
|
24
|
+
const container = ref.current;
|
|
25
|
+
requestAnimationFrame(() => {
|
|
26
|
+
const targetScroll = todayOffset * dayWidth - container.clientWidth / 3;
|
|
27
|
+
container.scrollLeft = Math.max(0, targetScroll);
|
|
28
|
+
});
|
|
29
|
+
// Only run on mount
|
|
30
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
+
}, []);
|
|
32
|
+
// Keyboard navigation
|
|
33
|
+
const handleKeyDown = useCallback((e) => {
|
|
34
|
+
const taskRows = rows.filter((r) => r.type === "task");
|
|
35
|
+
if (taskRows.length === 0)
|
|
36
|
+
return;
|
|
37
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
const currentIndex = focusedTaskId
|
|
40
|
+
? taskRows.findIndex((r) => r.type === "task" && r.task.id === focusedTaskId)
|
|
41
|
+
: -1;
|
|
42
|
+
let nextIndex;
|
|
43
|
+
if (e.key === "ArrowDown") {
|
|
44
|
+
nextIndex = currentIndex < taskRows.length - 1 ? currentIndex + 1 : 0;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
nextIndex = currentIndex > 0 ? currentIndex - 1 : taskRows.length - 1;
|
|
48
|
+
}
|
|
49
|
+
const nextRow = taskRows[nextIndex];
|
|
50
|
+
if (nextRow.type === "task") {
|
|
51
|
+
setFocusedTaskId(nextRow.task.id);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if ((e.key === "Enter" || e.key === " ") &&
|
|
55
|
+
focusedTaskId) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
const taskRow = taskRows.find((r) => r.type === "task" && r.task.id === focusedTaskId);
|
|
58
|
+
if ((taskRow === null || taskRow === void 0 ? void 0 : taskRow.type) === "task" && onTaskClick) {
|
|
59
|
+
onTaskClick(taskRow.task, e);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else if (e.key === "Escape") {
|
|
63
|
+
setFocusedTaskId(null);
|
|
64
|
+
}
|
|
65
|
+
}, [rows, focusedTaskId, setFocusedTaskId, onTaskClick]);
|
|
66
|
+
if (tasks.length === 0) {
|
|
67
|
+
return (jsx("div", { className: cn(theme.chartPanelStyle, "items-center justify-center"), children: jsxs("div", { className: "flex flex-col items-center gap-2 text-[var(--color-text-muted)]", children: [jsx(CalendarDaysIcon, { className: "size-10 opacity-40" }), jsx("div", { className: "text-base font-medium", children: "No tasks to display" }), jsx("div", { className: "text-sm opacity-70", children: "Add tasks to see them on the timeline" })] }) }));
|
|
68
|
+
}
|
|
69
|
+
return (jsx("div", { className: cn(theme.chartPanelStyle), children: jsx("div", { ref: ref, className: "overflow-auto flex-1 min-h-0 focus:outline-none", onScroll: onScroll, onKeyDown: handleKeyDown, tabIndex: 0, role: "grid", "aria-label": "Gantt chart timeline", "data-gantt-chart-scroll": true, children: jsxs("div", { style: { width: totalWidth }, children: [jsx("div", { className: "sticky top-0 z-10", children: jsx(GanttTimelineHeader, { days: days, monthSpans: monthSpans }) }), jsxs("div", { className: "relative", style: { height: bodyHeight }, children: [jsx(GanttTimelineGrid, { days: days, height: bodyHeight }), jsx(GanttDependencyArrows, {}), rows.map((row, i) => {
|
|
70
|
+
const top = i * rowHeight;
|
|
71
|
+
if (row.type === "group") {
|
|
72
|
+
return (jsx(GanttGroupBar, { row: row, top: top }, `group-${row.group.id}`));
|
|
73
|
+
}
|
|
74
|
+
if (row.task.milestone) {
|
|
75
|
+
return (jsx(GanttMilestone, { task: row.task, group: row.group, top: top }, `milestone-${row.task.id}`));
|
|
76
|
+
}
|
|
77
|
+
return (jsx(GanttTaskBar, { task: row.task, group: row.group, top: top }, `task-${row.task.id}`));
|
|
78
|
+
})] })] }) }) }));
|
|
79
|
+
});
|
|
80
|
+
GanttChartPanel.displayName = "GanttChartPanel";
|
|
81
|
+
|
|
82
|
+
export { GanttChartPanel };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useGanttContext, useGanttInteraction } from './GanttChart.js';
|
|
4
|
+
import { buildDependencyArrows } from './GanttChart.utils.js';
|
|
5
|
+
|
|
6
|
+
const GanttDependencyArrows = () => {
|
|
7
|
+
const { tasks, rows, dayWidth, rowHeight, rangeStart } = useGanttContext();
|
|
8
|
+
const { hoveredTaskId, activeDrag } = useGanttInteraction();
|
|
9
|
+
const arrows = useMemo(() => buildDependencyArrows(tasks, rows, dayWidth, rowHeight, rangeStart, activeDrag), [tasks, rows, dayWidth, rowHeight, rangeStart, activeDrag]);
|
|
10
|
+
if (arrows.length === 0)
|
|
11
|
+
return null;
|
|
12
|
+
// When a task is hovered, determine which arrows are connected to it
|
|
13
|
+
const isArrowConnected = (arrowId) => {
|
|
14
|
+
if (!hoveredTaskId)
|
|
15
|
+
return false;
|
|
16
|
+
// Arrow id format: "sourceId->targetId"
|
|
17
|
+
const [sourceId, targetId] = arrowId.split("->");
|
|
18
|
+
return sourceId === hoveredTaskId || targetId === hoveredTaskId;
|
|
19
|
+
};
|
|
20
|
+
return (jsxs("svg", { className: "absolute inset-0 pointer-events-none", style: { overflow: "visible" }, children: [jsxs("defs", { children: [jsx("marker", { id: "gantt-arrowhead", markerWidth: "8", markerHeight: "6", refX: "8", refY: "3", orient: "auto", children: jsx("path", { d: "M 0 0 L 8 3 L 0 6 Z", fill: "var(--color-text-secondary, #888)" }) }), jsx("marker", { id: "gantt-arrowhead-highlight", markerWidth: "8", markerHeight: "6", refX: "8", refY: "3", orient: "auto", children: jsx("path", { d: "M 0 0 L 8 3 L 0 6 Z", fill: "var(--color-primary, #3B82F6)" }) })] }), arrows.map((arrow) => {
|
|
21
|
+
const connected = isArrowConnected(arrow.id);
|
|
22
|
+
const faded = hoveredTaskId !== null && !connected;
|
|
23
|
+
return (jsx("path", { d: arrow.d, fill: "none", stroke: connected
|
|
24
|
+
? "var(--color-primary, #3B82F6)"
|
|
25
|
+
: "var(--color-text-secondary, #888)", strokeWidth: connected ? 2.5 : 1.5, strokeDasharray: arrow.isBackward ? "4 3" : undefined, markerEnd: connected
|
|
26
|
+
? "url(#gantt-arrowhead-highlight)"
|
|
27
|
+
: "url(#gantt-arrowhead)", opacity: faded ? 0.15 : connected ? 1 : 0.6, style: {
|
|
28
|
+
transition: activeDrag
|
|
29
|
+
? "none"
|
|
30
|
+
: "opacity 0.15s, stroke-width 0.15s",
|
|
31
|
+
} }, arrow.id));
|
|
32
|
+
})] }));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { GanttDependencyArrows };
|