@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,26 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { useGanttContext } from './GanttChart.js';
|
|
5
|
+
import { getDayOffset } from './GanttChart.utils.js';
|
|
6
|
+
import { getDaysBetween } from '../../../utils/dateUtils.js';
|
|
7
|
+
|
|
8
|
+
const GanttGroupBar = React__default.memo(({ row, top }) => {
|
|
9
|
+
const { theme, dayWidth, rangeStart, rowHeight } = useGanttContext();
|
|
10
|
+
if (row.taskCount === 0)
|
|
11
|
+
return null;
|
|
12
|
+
const offset = getDayOffset(row.earliestStart, rangeStart);
|
|
13
|
+
const span = getDaysBetween(row.earliestStart, row.latestEnd);
|
|
14
|
+
const left = offset * dayWidth;
|
|
15
|
+
const width = span * dayWidth;
|
|
16
|
+
const barHeight = 6;
|
|
17
|
+
return (jsx("div", { className: cn(theme.groupBarStyle), style: {
|
|
18
|
+
left,
|
|
19
|
+
width: Math.max(width, dayWidth),
|
|
20
|
+
top: top + rowHeight - barHeight - 4,
|
|
21
|
+
height: barHeight,
|
|
22
|
+
backgroundColor: row.group.color,
|
|
23
|
+
} }));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { GanttGroupBar };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { GanttTask, GanttGroup } from "./GanttChart.types";
|
|
3
|
+
interface GanttMilestoneProps {
|
|
4
|
+
task: GanttTask;
|
|
5
|
+
group: GanttGroup;
|
|
6
|
+
top: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const GanttMilestone: React.FC<GanttMilestoneProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { getDayOffset, formatDateShort } from './GanttChart.utils.js';
|
|
4
|
+
import { useGanttContext } from './GanttChart.js';
|
|
5
|
+
import { Tooltip } from '../../core/Tooltip/Tooltip.js';
|
|
6
|
+
import '../../core/Tooltip/Tooltip.animations.js';
|
|
7
|
+
import { GanttTaskContextMenu } from './GanttTaskContextMenu.js';
|
|
8
|
+
|
|
9
|
+
const GanttMilestone = React__default.memo(({ task, group, top, }) => {
|
|
10
|
+
var _a;
|
|
11
|
+
const { dayWidth, rangeStart, rowHeight, onTaskClick, readonly } = useGanttContext();
|
|
12
|
+
const offset = getDayOffset(task.endDate, rangeStart);
|
|
13
|
+
const left = offset * dayWidth + dayWidth / 2;
|
|
14
|
+
const size = 14;
|
|
15
|
+
const barColor = (_a = task.color) !== null && _a !== void 0 ? _a : group.color;
|
|
16
|
+
const tooltipContent = (jsxs("div", { className: "text-sm space-y-1", children: [jsx("div", { className: "font-semibold", children: task.title }), jsxs("div", { className: "flex items-center gap-1.5 text-[var(--color-text-placeholder)]", children: [jsx("span", { className: "inline-block size-2 rounded-full shrink-0", style: { backgroundColor: group.color } }), group.title] }), jsx("div", { children: formatDateShort(task.endDate) })] }));
|
|
17
|
+
const handleClick = (e) => {
|
|
18
|
+
onTaskClick === null || onTaskClick === void 0 ? void 0 : onTaskClick(task, e);
|
|
19
|
+
};
|
|
20
|
+
const handleKeyDown = (e) => {
|
|
21
|
+
if ((e.key === "Enter" || e.key === " ") && onTaskClick) {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
onTaskClick(task, e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return (jsx(GanttTaskContextMenu, { task: task, children: jsx(Tooltip, { content: tooltipContent, placement: "top", children: jsxs("div", { className: "absolute", style: {
|
|
27
|
+
left: left - size / 2,
|
|
28
|
+
top: top + rowHeight / 2 - size / 2,
|
|
29
|
+
}, onClick: onTaskClick ? handleClick : undefined, onKeyDown: handleKeyDown, role: "button", tabIndex: onTaskClick ? 0 : undefined, "aria-label": `Milestone: ${task.title}`, children: [jsx("div", { className: `hover:scale-110 transition-transform ${readonly ? "cursor-default" : "cursor-pointer"}`, style: {
|
|
30
|
+
width: size,
|
|
31
|
+
height: size,
|
|
32
|
+
backgroundColor: barColor,
|
|
33
|
+
border: "2px solid var(--color-background, white)",
|
|
34
|
+
transform: "rotate(45deg)",
|
|
35
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.2)",
|
|
36
|
+
} }), jsx("span", { className: "absolute text-sm font-medium whitespace-nowrap pointer-events-none", style: {
|
|
37
|
+
left: size + 4,
|
|
38
|
+
top: size / 2,
|
|
39
|
+
transform: "translateY(-50%)",
|
|
40
|
+
color: barColor,
|
|
41
|
+
}, children: task.title })] }) }) }));
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { GanttMilestone };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
const GanttProgressCircle = ({ progress, color, size = 20, strokeWidth = 2.5, }) => {
|
|
4
|
+
const radius = (size - strokeWidth) / 2;
|
|
5
|
+
const circumference = 2 * Math.PI * radius;
|
|
6
|
+
const offset = circumference - (progress / 100) * circumference;
|
|
7
|
+
const center = size / 2;
|
|
8
|
+
return (jsxs("svg", { width: size, height: size, className: "shrink-0", children: [jsx("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: "currentColor", strokeWidth: strokeWidth, className: "text-[var(--color-border)]" }), jsx("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: color, strokeWidth: strokeWidth, strokeDasharray: circumference, strokeDashoffset: offset, strokeLinecap: "round", transform: `rotate(-90 ${center} ${center})` }), progress === 100 && (jsx("path", { d: `M${center - 3} ${center} l2 2.5 l4 -4.5`, fill: "none", stroke: color, strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }))] }));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { GanttProgressCircle };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useCallback } from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { useGanttContext } from './GanttChart.js';
|
|
5
|
+
|
|
6
|
+
const STEP = 20;
|
|
7
|
+
const MIN_WIDTH = 200;
|
|
8
|
+
const MAX_WIDTH = 800;
|
|
9
|
+
const GanttSplitter = () => {
|
|
10
|
+
const { theme, tablePanelWidth, setTablePanelWidth } = useGanttContext();
|
|
11
|
+
const startX = useRef(0);
|
|
12
|
+
const startWidth = useRef(0);
|
|
13
|
+
const onPointerDown = useCallback((e) => {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
startX.current = e.clientX;
|
|
16
|
+
startWidth.current = tablePanelWidth;
|
|
17
|
+
const onPointerMove = (ev) => {
|
|
18
|
+
const delta = ev.clientX - startX.current;
|
|
19
|
+
const next = Math.max(MIN_WIDTH, Math.min(MAX_WIDTH, startWidth.current + delta));
|
|
20
|
+
setTablePanelWidth(next);
|
|
21
|
+
};
|
|
22
|
+
const onPointerUp = () => {
|
|
23
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
24
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
25
|
+
};
|
|
26
|
+
document.addEventListener("pointermove", onPointerMove);
|
|
27
|
+
document.addEventListener("pointerup", onPointerUp);
|
|
28
|
+
}, [tablePanelWidth, setTablePanelWidth]);
|
|
29
|
+
const onKeyDown = useCallback((e) => {
|
|
30
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
const delta = e.key === "ArrowRight" ? STEP : -STEP;
|
|
33
|
+
setTablePanelWidth(Math.max(MIN_WIDTH, Math.min(MAX_WIDTH, tablePanelWidth + delta)));
|
|
34
|
+
}
|
|
35
|
+
}, [tablePanelWidth, setTablePanelWidth]);
|
|
36
|
+
return (jsx("div", { className: cn(theme.splitterStyle), onPointerDown: onPointerDown, onKeyDown: onKeyDown, role: "separator", "aria-orientation": "vertical", "aria-valuenow": tablePanelWidth, "aria-valuemin": MIN_WIDTH, "aria-valuemax": MAX_WIDTH, "aria-label": "Resize table panel", tabIndex: 0 }));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { GanttSplitter };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { motion } from 'motion/react';
|
|
4
|
+
import { ChevronRightIcon, PlusIcon } from '@heroicons/react/24/outline';
|
|
5
|
+
import { cn } from '../../../utils/cn.js';
|
|
6
|
+
import { useGanttContext } from './GanttChart.js';
|
|
7
|
+
import { chevronVariants } from './GanttChart.animations.js';
|
|
8
|
+
|
|
9
|
+
const GanttTableGroupRow = React__default.memo(({ row, }) => {
|
|
10
|
+
const { theme, collapsedGroups, toggleGroup, onTaskAdd, rowHeight, readonly } = useGanttContext();
|
|
11
|
+
const isCollapsed = collapsedGroups.includes(row.group.id);
|
|
12
|
+
return (jsxs("div", { className: cn(theme.tableGroupRowStyle, "group"), style: { height: rowHeight }, onClick: () => toggleGroup(row.group.id), onKeyDown: (e) => {
|
|
13
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
toggleGroup(row.group.id);
|
|
16
|
+
}
|
|
17
|
+
}, role: "button", tabIndex: 0, "aria-expanded": !isCollapsed, "aria-label": `${row.group.title} — ${row.completedCount} of ${row.taskCount} completed`, children: [jsxs("div", { className: "flex items-center gap-2 px-3 flex-1 min-w-0", children: [jsx(motion.div, { variants: chevronVariants, animate: isCollapsed ? "collapsed" : "open", children: jsx(ChevronRightIcon, { className: "size-4 text-[var(--color-text-muted)]" }) }), jsx("div", { className: "size-2.5 rounded-full shrink-0", style: { backgroundColor: row.group.color } }), jsx("span", { className: "font-medium text-[var(--color-text-primary)] truncate", children: row.group.title }), jsxs("span", { className: "text-sm text-[var(--color-text-muted)] shrink-0", children: [row.completedCount, "/", row.taskCount] })] }), onTaskAdd && !readonly && (jsx("button", { className: "p-1 mr-2 rounded hover:bg-[var(--color-background-tertiary)] text-[var(--color-text-muted)] opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity", "aria-label": `Add task to ${row.group.title}`, onClick: (e) => {
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
onTaskAdd(row.group.id);
|
|
20
|
+
}, children: jsx(PlusIcon, { className: "size-4" }) }))] }));
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export { GanttTableGroupRow };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../../../utils/cn.js';
|
|
3
|
+
import { useGanttContext } from './GanttChart.js';
|
|
4
|
+
|
|
5
|
+
const GanttTableHeader = () => {
|
|
6
|
+
const { theme, columns } = useGanttContext();
|
|
7
|
+
return (jsx("div", { className: cn(theme.tableHeaderStyle), style: { height: 56 }, children: columns.map((col) => {
|
|
8
|
+
var _a;
|
|
9
|
+
return (jsx("div", { className: cn(theme.tableHeaderCellStyle, col.align === "center" && "text-center", col.align === "right" && "text-right"), style: { width: (_a = col.width) !== null && _a !== void 0 ? _a : 120 }, children: col.header }, col.id));
|
|
10
|
+
}) }));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { GanttTableHeader };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { useGanttContext } from './GanttChart.js';
|
|
5
|
+
import { GanttTableHeader } from './GanttTableHeader.js';
|
|
6
|
+
import { GanttTableGroupRow } from './GanttTableGroupRow.js';
|
|
7
|
+
import { GanttTableTaskRow } from './GanttTableTaskRow.js';
|
|
8
|
+
|
|
9
|
+
const GanttTablePanel = forwardRef(({ onScroll }, ref) => {
|
|
10
|
+
const { theme, rows, tablePanelWidth } = useGanttContext();
|
|
11
|
+
return (jsxs("div", { className: cn(theme.tablePanelStyle), style: { width: tablePanelWidth }, children: [jsx(GanttTableHeader, {}), jsx("div", { ref: ref, className: "overflow-y-auto overflow-x-hidden flex-1 min-h-0", onScroll: onScroll, children: rows.map((row, i) => {
|
|
12
|
+
if (row.type === "group") {
|
|
13
|
+
return (jsx(GanttTableGroupRow, { row: row }, `group-${row.group.id}`));
|
|
14
|
+
}
|
|
15
|
+
return (jsx(GanttTableTaskRow, { task: row.task, group: row.group }, `task-${row.task.id}`));
|
|
16
|
+
}) })] }));
|
|
17
|
+
});
|
|
18
|
+
GanttTablePanel.displayName = "GanttTablePanel";
|
|
19
|
+
|
|
20
|
+
export { GanttTablePanel };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { useGanttContext, useGanttInteraction } from './GanttChart.js';
|
|
5
|
+
import { GanttTaskContextMenu } from './GanttTaskContextMenu.js';
|
|
6
|
+
|
|
7
|
+
function getCellValue(task, group, column) {
|
|
8
|
+
if (column.cell) {
|
|
9
|
+
return column.cell(task, group);
|
|
10
|
+
}
|
|
11
|
+
const raw = typeof column.accessor === "function"
|
|
12
|
+
? column.accessor(task)
|
|
13
|
+
: task[column.accessor];
|
|
14
|
+
return raw != null ? String(raw) : "";
|
|
15
|
+
}
|
|
16
|
+
const GanttTableTaskRow = React__default.memo(({ task, group, }) => {
|
|
17
|
+
const { theme, columns, rowHeight, onTaskClick } = useGanttContext();
|
|
18
|
+
const { focusedTaskId } = useGanttInteraction();
|
|
19
|
+
return (jsx(GanttTaskContextMenu, { task: task, children: jsx("div", { className: cn(theme.tableTaskRowStyle, "group", onTaskClick && "cursor-pointer", focusedTaskId === task.id && "bg-[var(--color-primary)]/5"), style: { height: rowHeight }, onClick: onTaskClick ? (e) => onTaskClick(task, e) : undefined, onKeyDown: onTaskClick ? (e) => {
|
|
20
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
onTaskClick(task, e);
|
|
23
|
+
}
|
|
24
|
+
} : undefined, role: onTaskClick ? "button" : "row", tabIndex: onTaskClick ? 0 : undefined, "aria-label": task.title, children: columns.map((col) => {
|
|
25
|
+
var _a;
|
|
26
|
+
return (jsx("div", { className: cn(theme.tableCellStyle, "flex items-center", col.align === "center" && "justify-center", col.align === "right" && "justify-end"), style: { width: (_a = col.width) !== null && _a !== void 0 ? _a : 120 }, children: getCellValue(task, group, col) }, col.id));
|
|
27
|
+
}) }) }));
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { GanttTableTaskRow };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useState, useCallback, useMemo } from 'react';
|
|
3
|
+
import { motion } from 'motion/react';
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
import { useGanttContext, useGanttInteraction } from './GanttChart.js';
|
|
6
|
+
import { getDayOffset, calculateExpectedProgress, formatDateShort, formatDuration } from './GanttChart.utils.js';
|
|
7
|
+
import { ChartTooltip } from '../../charts/shared/ChartTooltip/ChartTooltip.js';
|
|
8
|
+
import { Avatar } from '../../core/Avatar/Avatar.js';
|
|
9
|
+
import { GanttTaskContextMenu } from './GanttTaskContextMenu.js';
|
|
10
|
+
import { taskBarVariants } from './GanttChart.animations.js';
|
|
11
|
+
import { useGanttDrag } from './hooks/useGanttDrag.js';
|
|
12
|
+
import { getDaysBetween, addDays, toDate } from '../../../utils/dateUtils.js';
|
|
13
|
+
|
|
14
|
+
const GanttTaskBar = React__default.memo(({ task, group, top, }) => {
|
|
15
|
+
var _a;
|
|
16
|
+
const { theme, dayWidth, rangeStart, rowHeight, readonly, readonlyDates, readonlyProgress, onTaskUpdate, onTaskClick, tasks, } = useGanttContext();
|
|
17
|
+
const { hoveredTaskId, setHoveredTaskId, focusedTaskId, setActiveDrag, } = useGanttInteraction();
|
|
18
|
+
const [tooltipPos, setTooltipPos] = useState(null);
|
|
19
|
+
const offset = getDayOffset(task.startDate, rangeStart);
|
|
20
|
+
const span = getDaysBetween(task.startDate, task.endDate);
|
|
21
|
+
const left = offset * dayWidth;
|
|
22
|
+
const width = Math.max(span * dayWidth, dayWidth);
|
|
23
|
+
const barColor = (_a = task.color) !== null && _a !== void 0 ? _a : group.color;
|
|
24
|
+
const barHeight = rowHeight - 8;
|
|
25
|
+
const canDragDates = !readonly && !readonlyDates && !!onTaskUpdate;
|
|
26
|
+
const canDragProgress = !readonly && !readonlyProgress && !!onTaskUpdate;
|
|
27
|
+
const expectedProgress = calculateExpectedProgress(task.startDate, task.endDate);
|
|
28
|
+
const isBehindSchedule = !task.completed && task.progress < expectedProgress;
|
|
29
|
+
// ----- Drag: Move -----
|
|
30
|
+
const handleMoveDragEnd = useCallback((result) => {
|
|
31
|
+
if (!onTaskUpdate || result.daysDelta === 0)
|
|
32
|
+
return;
|
|
33
|
+
const newStart = addDays(task.startDate, result.daysDelta);
|
|
34
|
+
const newEnd = addDays(task.endDate, result.daysDelta);
|
|
35
|
+
onTaskUpdate(task.id, {
|
|
36
|
+
startDate: newStart,
|
|
37
|
+
endDate: newEnd,
|
|
38
|
+
});
|
|
39
|
+
}, [onTaskUpdate, task.id, task.startDate, task.endDate]);
|
|
40
|
+
const moveDrag = useGanttDrag({
|
|
41
|
+
dayWidth,
|
|
42
|
+
mode: "move",
|
|
43
|
+
barWidthPx: width,
|
|
44
|
+
originalProgress: task.progress,
|
|
45
|
+
disabled: !canDragDates,
|
|
46
|
+
onDragEnd: handleMoveDragEnd,
|
|
47
|
+
onDragStateChange: useCallback((isDragging, deltaX) => {
|
|
48
|
+
setActiveDrag(isDragging ? { taskId: task.id, mode: "move", deltaX } : null);
|
|
49
|
+
}, [setActiveDrag, task.id]),
|
|
50
|
+
});
|
|
51
|
+
// ----- Drag: Resize left -----
|
|
52
|
+
const handleResizeLeftEnd = useCallback((result) => {
|
|
53
|
+
if (!onTaskUpdate || result.daysDelta === 0)
|
|
54
|
+
return;
|
|
55
|
+
const newStart = addDays(task.startDate, result.daysDelta);
|
|
56
|
+
// Ensure start doesn't go past end
|
|
57
|
+
if (toDate(newStart).getTime() >= toDate(task.endDate).getTime())
|
|
58
|
+
return;
|
|
59
|
+
onTaskUpdate(task.id, { startDate: newStart });
|
|
60
|
+
}, [onTaskUpdate, task.id, task.startDate, task.endDate]);
|
|
61
|
+
const resizeLeftDrag = useGanttDrag({
|
|
62
|
+
dayWidth,
|
|
63
|
+
mode: "resize-left",
|
|
64
|
+
barWidthPx: width,
|
|
65
|
+
originalProgress: task.progress,
|
|
66
|
+
disabled: !canDragDates,
|
|
67
|
+
onDragEnd: handleResizeLeftEnd,
|
|
68
|
+
onDragStateChange: useCallback((isDragging, deltaX) => {
|
|
69
|
+
setActiveDrag(isDragging ? { taskId: task.id, mode: "resize-left", deltaX } : null);
|
|
70
|
+
}, [setActiveDrag, task.id]),
|
|
71
|
+
});
|
|
72
|
+
// ----- Drag: Resize right -----
|
|
73
|
+
const handleResizeRightEnd = useCallback((result) => {
|
|
74
|
+
if (!onTaskUpdate || result.daysDelta === 0)
|
|
75
|
+
return;
|
|
76
|
+
const newEnd = addDays(task.endDate, result.daysDelta);
|
|
77
|
+
// Ensure end doesn't go before start
|
|
78
|
+
if (toDate(newEnd).getTime() <= toDate(task.startDate).getTime())
|
|
79
|
+
return;
|
|
80
|
+
onTaskUpdate(task.id, { endDate: newEnd });
|
|
81
|
+
}, [onTaskUpdate, task.id, task.startDate, task.endDate]);
|
|
82
|
+
const resizeRightDrag = useGanttDrag({
|
|
83
|
+
dayWidth,
|
|
84
|
+
mode: "resize-right",
|
|
85
|
+
barWidthPx: width,
|
|
86
|
+
originalProgress: task.progress,
|
|
87
|
+
disabled: !canDragDates,
|
|
88
|
+
onDragEnd: handleResizeRightEnd,
|
|
89
|
+
onDragStateChange: useCallback((isDragging, deltaX) => {
|
|
90
|
+
setActiveDrag(isDragging ? { taskId: task.id, mode: "resize-right", deltaX } : null);
|
|
91
|
+
}, [setActiveDrag, task.id]),
|
|
92
|
+
});
|
|
93
|
+
// ----- Drag: Progress -----
|
|
94
|
+
const handleProgressDragEnd = useCallback((result) => {
|
|
95
|
+
if (!onTaskUpdate)
|
|
96
|
+
return;
|
|
97
|
+
onTaskUpdate(task.id, {
|
|
98
|
+
progress: result.newProgress,
|
|
99
|
+
completed: result.newProgress === 100,
|
|
100
|
+
});
|
|
101
|
+
}, [onTaskUpdate, task.id]);
|
|
102
|
+
const progressDrag = useGanttDrag({
|
|
103
|
+
dayWidth,
|
|
104
|
+
mode: "progress",
|
|
105
|
+
barWidthPx: width,
|
|
106
|
+
originalProgress: task.progress,
|
|
107
|
+
disabled: !canDragProgress,
|
|
108
|
+
onDragEnd: handleProgressDragEnd,
|
|
109
|
+
});
|
|
110
|
+
const anyDragging = moveDrag.isDragging ||
|
|
111
|
+
resizeLeftDrag.isDragging ||
|
|
112
|
+
resizeRightDrag.isDragging ||
|
|
113
|
+
progressDrag.isDragging;
|
|
114
|
+
const anyDidDrag = moveDrag.didDrag ||
|
|
115
|
+
resizeLeftDrag.didDrag ||
|
|
116
|
+
resizeRightDrag.didDrag ||
|
|
117
|
+
progressDrag.didDrag;
|
|
118
|
+
// ----- Computed visual positions during drag -----
|
|
119
|
+
let visualLeft = left;
|
|
120
|
+
let visualWidth = width;
|
|
121
|
+
let displayProgress = task.progress;
|
|
122
|
+
if (moveDrag.isDragging) {
|
|
123
|
+
visualLeft = left + moveDrag.dragDeltaX;
|
|
124
|
+
}
|
|
125
|
+
else if (resizeLeftDrag.isDragging) {
|
|
126
|
+
const delta = resizeLeftDrag.dragDeltaX;
|
|
127
|
+
// Clamp so width never goes below 1 day
|
|
128
|
+
const maxDelta = width - dayWidth;
|
|
129
|
+
const clampedDelta = Math.min(delta, maxDelta);
|
|
130
|
+
visualLeft = left + clampedDelta;
|
|
131
|
+
visualWidth = width - clampedDelta;
|
|
132
|
+
}
|
|
133
|
+
else if (resizeRightDrag.isDragging) {
|
|
134
|
+
const delta = resizeRightDrag.dragDeltaX;
|
|
135
|
+
// Clamp so width never goes below 1 day
|
|
136
|
+
visualWidth = Math.max(width + delta, dayWidth);
|
|
137
|
+
}
|
|
138
|
+
if (progressDrag.isDragging) {
|
|
139
|
+
displayProgress = progressDrag.dragProgress;
|
|
140
|
+
}
|
|
141
|
+
const isNarrow = visualWidth <= 80;
|
|
142
|
+
// ----- Hover highlighting (dependency connections) -----
|
|
143
|
+
const isHighlighted = useMemo(() => {
|
|
144
|
+
var _a, _b, _c;
|
|
145
|
+
if (!hoveredTaskId || hoveredTaskId === task.id)
|
|
146
|
+
return false;
|
|
147
|
+
// Check if this task depends on hovered task
|
|
148
|
+
if ((_a = task.dependencies) === null || _a === void 0 ? void 0 : _a.includes(hoveredTaskId))
|
|
149
|
+
return true;
|
|
150
|
+
// Check if hovered task depends on this task
|
|
151
|
+
const hoveredTask = tasks.find((t) => t.id === hoveredTaskId);
|
|
152
|
+
return (_c = (_b = hoveredTask === null || hoveredTask === void 0 ? void 0 : hoveredTask.dependencies) === null || _b === void 0 ? void 0 : _b.includes(task.id)) !== null && _c !== void 0 ? _c : false;
|
|
153
|
+
}, [hoveredTaskId, task.id, task.dependencies, tasks]);
|
|
154
|
+
const isFaded = hoveredTaskId !== null &&
|
|
155
|
+
hoveredTaskId !== task.id &&
|
|
156
|
+
!isHighlighted;
|
|
157
|
+
const isFocused = focusedTaskId === task.id;
|
|
158
|
+
// ----- Click handler -----
|
|
159
|
+
const handleClick = (e) => {
|
|
160
|
+
if (anyDidDrag)
|
|
161
|
+
return;
|
|
162
|
+
onTaskClick === null || onTaskClick === void 0 ? void 0 : onTaskClick(task, e);
|
|
163
|
+
};
|
|
164
|
+
// ----- Tooltip -----
|
|
165
|
+
const tooltipContent = (jsxs("div", { className: "text-sm space-y-2 min-w-[180px]", children: [jsx("div", { className: "font-semibold text-base", children: task.title }), jsxs("div", { className: "flex items-center gap-1.5 opacity-70", children: [jsx("span", { className: "inline-block size-2 rounded-full shrink-0", style: { backgroundColor: group.color } }), group.title] }), jsxs("div", { className: "space-y-0.5", children: [jsxs("div", { children: [formatDateShort(task.startDate), " \u2014 ", formatDateShort(task.endDate)] }), jsx("div", { className: "opacity-70", children: formatDuration(task.startDate, task.endDate) })] }), jsxs("div", { children: [jsxs("div", { className: "flex justify-between mb-1", children: [jsx("span", { children: "Progress" }), jsxs("span", { className: "font-medium", children: [task.progress, "%"] })] }), jsx("div", { className: "h-1.5 rounded-full bg-white/20 overflow-hidden", children: jsx("div", { className: "h-full rounded-full", style: {
|
|
166
|
+
width: `${task.progress}%`,
|
|
167
|
+
backgroundColor: barColor,
|
|
168
|
+
} }) })] }), task.assignee && (jsxs("div", { className: "flex items-center gap-1.5 pt-0.5", children: [jsx(Avatar, { src: task.assignee.avatar, alt: task.assignee.name, size: "xs" }), jsx("span", { children: task.assignee.name })] })), isBehindSchedule && (jsxs("div", { className: "text-[var(--color-warning)] text-[10px]", children: ["Behind schedule (expected ", expectedProgress, "%)"] }))] }));
|
|
169
|
+
return (jsxs(Fragment, { children: [jsx(GanttTaskContextMenu, { task: task, children: jsxs("div", { className: "absolute", style: {
|
|
170
|
+
left: visualLeft,
|
|
171
|
+
top: top + (rowHeight - barHeight) / 2,
|
|
172
|
+
}, onMouseEnter: (e) => {
|
|
173
|
+
if (!anyDragging) {
|
|
174
|
+
setTooltipPos({ x: e.clientX, y: e.clientY });
|
|
175
|
+
setHoveredTaskId(task.id);
|
|
176
|
+
}
|
|
177
|
+
}, onMouseMove: (e) => {
|
|
178
|
+
if (!anyDragging) {
|
|
179
|
+
setTooltipPos({ x: e.clientX, y: e.clientY });
|
|
180
|
+
}
|
|
181
|
+
}, onMouseLeave: () => {
|
|
182
|
+
setTooltipPos(null);
|
|
183
|
+
setHoveredTaskId(null);
|
|
184
|
+
}, onClick: onTaskClick ? handleClick : undefined, onPointerDown: canDragDates ? moveDrag.handlePointerDown : undefined, role: "button", "aria-label": task.title, children: [jsxs(motion.div, { className: cn(theme.taskBarStyle, "group", task.completed && "opacity-60", canDragDates && !anyDragging && "cursor-grab", anyDragging && "cursor-grabbing", !canDragDates && "cursor-default", isHighlighted && "ring-2 ring-white/60", isFaded && "opacity-40", isFocused && "ring-2 ring-[var(--color-primary)] ring-offset-1"), style: {
|
|
185
|
+
width: visualWidth,
|
|
186
|
+
height: barHeight,
|
|
187
|
+
backgroundColor: barColor,
|
|
188
|
+
border: "1px solid rgba(0,0,0,0.12)",
|
|
189
|
+
borderRadius: "2rem",
|
|
190
|
+
transformOrigin: "left center",
|
|
191
|
+
transition: anyDragging ? "none" : undefined,
|
|
192
|
+
}, variants: taskBarVariants, initial: "hidden", animate: "visible", whileHover: anyDragging ? undefined : { filter: "brightness(0.96)" }, children: [jsx("div", { className: "absolute inset-0 rounded-full", style: {
|
|
193
|
+
width: `${displayProgress}%`,
|
|
194
|
+
background: "linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15))",
|
|
195
|
+
} }), isBehindSchedule && (jsx("div", { className: "absolute top-0 bottom-0 w-px", style: {
|
|
196
|
+
left: `${expectedProgress}%`,
|
|
197
|
+
borderLeft: "2px dashed rgba(255,255,255,0.5)",
|
|
198
|
+
} })), task.completed && (jsx("div", { className: "absolute top-1/2 left-2 right-2 h-px bg-white/60", style: { transform: "translateY(-0.5px)" } })), canDragDates && (jsx("div", { className: "absolute left-0 top-0 bottom-0 w-2 cursor-ew-resize z-20 rounded-l-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-black/10", onPointerDown: resizeLeftDrag.handlePointerDown })), canDragDates && (jsx("div", { className: "absolute right-0 top-0 bottom-0 w-2 cursor-ew-resize z-20 rounded-r-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-black/10", onPointerDown: resizeRightDrag.handlePointerDown })), canDragProgress && !isNarrow && (jsx("div", { className: "absolute top-0 bottom-0 w-3 cursor-ew-resize z-20 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", style: { left: `calc(${displayProgress}% - 6px)` }, onPointerDown: progressDrag.handlePointerDown, children: jsx("div", { className: "w-0.5 h-3 rounded-full bg-white/80 shadow" }) })), !isNarrow && (jsxs("div", { className: "relative flex items-center gap-1.5 px-1 z-10 min-w-0 pointer-events-none", children: [task.assignee && (jsx(Avatar, { src: task.assignee.avatar, alt: task.assignee.name, size: "xs" })), jsx("span", { className: "truncate text-sm text-[var(--color-text-inverse)] font-medium", children: task.title })] }))] }), isNarrow && (jsx("span", { className: "absolute text-sm font-medium whitespace-nowrap pointer-events-none", style: {
|
|
199
|
+
left: visualWidth + 6,
|
|
200
|
+
top: barHeight / 2,
|
|
201
|
+
transform: "translateY(-50%)",
|
|
202
|
+
color: barColor,
|
|
203
|
+
}, children: task.title }))] }) }), jsx(ChartTooltip, { active: !!tooltipPos && !anyDragging, position: tooltipPos !== null && tooltipPos !== void 0 ? tooltipPos : { x: 0, y: 0 }, content: tooltipContent })] }));
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
export { GanttTaskBar };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import type { GanttTask } from "./GanttChart.types";
|
|
3
|
+
interface GanttTaskContextMenuProps {
|
|
4
|
+
task: GanttTask;
|
|
5
|
+
children: ReactElement;
|
|
6
|
+
}
|
|
7
|
+
export declare const GanttTaskContextMenu: React.FC<GanttTaskContextMenuProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { CheckCircleIcon, DocumentDuplicateIcon, TrashIcon } from '@heroicons/react/24/outline';
|
|
3
|
+
import { ContextMenu } from '../../core/ContextMenu/ContextMenu.js';
|
|
4
|
+
import '../../core/ContextMenu/ContextMenu.theme.js';
|
|
5
|
+
import { useGanttContext } from './GanttChart.js';
|
|
6
|
+
|
|
7
|
+
const PROGRESS_STEPS = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
|
|
8
|
+
const GanttTaskContextMenu = ({ task, children, }) => {
|
|
9
|
+
const { onTaskUpdate, onTaskDuplicate, onTaskDelete, readonly } = useGanttContext();
|
|
10
|
+
// If readonly or no callbacks, just render children without wrapping
|
|
11
|
+
if (readonly || (!onTaskUpdate && !onTaskDuplicate && !onTaskDelete)) {
|
|
12
|
+
return jsx(Fragment, { children: children });
|
|
13
|
+
}
|
|
14
|
+
return (jsxs(ContextMenu, { children: [jsx(ContextMenu.Trigger, { children: children }), jsxs(ContextMenu.Content, { children: [onTaskUpdate && (jsxs(ContextMenu.Item, { onSelect: () => onTaskUpdate(task.id, { completed: !task.completed, progress: task.completed ? 0 : 100 }), children: [jsx(CheckCircleIcon, { className: "size-4 mr-2" }), task.completed ? "Mark as incomplete" : "Mark as done"] })), onTaskUpdate && (jsxs(ContextMenu.Sub, { children: [jsx(ContextMenu.SubTrigger, { children: "Progress" }), jsx(ContextMenu.SubContent, { children: PROGRESS_STEPS.map((val) => (jsxs(ContextMenu.Item, { onSelect: () => onTaskUpdate(task.id, { progress: val, completed: val === 100 }), children: [val, "%"] }, val))) })] })), (onTaskDuplicate || onTaskDelete) && jsx(ContextMenu.Separator, {}), onTaskDuplicate && (jsxs(ContextMenu.Item, { onSelect: () => onTaskDuplicate(task.id), children: [jsx(DocumentDuplicateIcon, { className: "size-4 mr-2" }), "Duplicate"] })), onTaskDelete && (jsxs(ContextMenu.Item, { onSelect: () => onTaskDelete(task.id), className: "text-[var(--color-danger)]", children: [jsx(TrashIcon, { className: "size-4 mr-2" }), "Delete"] }))] })] }));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { GanttTaskContextMenu };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { useGanttContext } from './GanttChart.js';
|
|
5
|
+
import { toDate, isWeekend } from '../../../utils/dateUtils.js';
|
|
6
|
+
|
|
7
|
+
const GanttTimelineGrid = ({ days, height, }) => {
|
|
8
|
+
const { theme, dayWidth, todayMarker, todayOffset, rows, rowHeight, holidays, gridLines, } = useGanttContext();
|
|
9
|
+
const totalWidth = days.length * dayWidth;
|
|
10
|
+
const showVertical = gridLines === "both" || gridLines === "vertical";
|
|
11
|
+
const showHorizontal = gridLines === "both" || gridLines === "horizontal";
|
|
12
|
+
// Build a dateKey -> holiday lookup
|
|
13
|
+
const holidayMap = useMemo(() => {
|
|
14
|
+
const map = new Map();
|
|
15
|
+
for (const h of holidays) {
|
|
16
|
+
const d = toDate(h.date);
|
|
17
|
+
const key = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
18
|
+
map.set(key, { label: h.label, color: h.color });
|
|
19
|
+
}
|
|
20
|
+
return map;
|
|
21
|
+
}, [holidays]);
|
|
22
|
+
return (jsxs("div", { className: "absolute inset-0 pointer-events-none", style: { width: totalWidth, height }, children: [days.map((day, i) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const key = `${day.getFullYear()}-${day.getMonth()}-${day.getDate()}`;
|
|
25
|
+
const holiday = holidayMap.get(key);
|
|
26
|
+
return (jsx("div", { className: cn("absolute top-0 bottom-0", showVertical && theme.gridLineStyle, isWeekend(day) && theme.weekendStyle), style: { left: i * dayWidth, width: dayWidth }, children: holiday && (jsxs(Fragment, { children: [jsx("div", { className: "absolute inset-0", style: {
|
|
27
|
+
backgroundColor: (_a = holiday.color) !== null && _a !== void 0 ? _a : "var(--color-warning-100, rgba(245, 158, 11, 0.08))",
|
|
28
|
+
} }), jsx("span", { className: "absolute bottom-1 left-1/2 -translate-x-1/2 text-[8px] whitespace-nowrap opacity-60", style: { color: (_b = holiday.color) !== null && _b !== void 0 ? _b : "var(--color-warning, #F59E0B)" }, children: holiday.label })] })) }, i));
|
|
29
|
+
}), showHorizontal &&
|
|
30
|
+
rows.map((_, i) => (jsx("div", { className: "absolute left-0 right-0 border-b border-[var(--color-border)]/20", style: { top: (i + 1) * rowHeight } }, `h-${i}`))), todayMarker && todayOffset !== null && (jsxs(Fragment, { children: [jsx("div", { className: cn("absolute top-0 bottom-0", theme.todayColumnStyle), style: { left: todayOffset * dayWidth, width: dayWidth } }), jsx("div", { className: cn("absolute top-0 bottom-0 z-10", theme.todayMarkerStyle), style: { left: todayOffset * dayWidth + dayWidth / 2 } })] }))] }));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { GanttTimelineGrid };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../../../utils/cn.js';
|
|
3
|
+
import { useGanttContext } from './GanttChart.js';
|
|
4
|
+
import { formatDayLabel } from './GanttChart.utils.js';
|
|
5
|
+
import { isSameDay, isWeekend } from '../../../utils/dateUtils.js';
|
|
6
|
+
|
|
7
|
+
function getDayLabel(day, zoom) {
|
|
8
|
+
switch (zoom) {
|
|
9
|
+
case "day":
|
|
10
|
+
return formatDayLabel(day, zoom);
|
|
11
|
+
case "week":
|
|
12
|
+
// Show day number only on Mondays
|
|
13
|
+
return day.getDay() === 1 ? `${day.getDate()}` : "";
|
|
14
|
+
case "quarter":
|
|
15
|
+
// Show day number on 1st, 8th, 15th, 22nd
|
|
16
|
+
return [1, 8, 15, 22].includes(day.getDate())
|
|
17
|
+
? `${day.getDate()}`
|
|
18
|
+
: "";
|
|
19
|
+
case "month":
|
|
20
|
+
// Show day number on 1st and 15th
|
|
21
|
+
return day.getDate() === 1 || day.getDate() === 15
|
|
22
|
+
? `${day.getDate()}`
|
|
23
|
+
: "";
|
|
24
|
+
case "year":
|
|
25
|
+
// Show only on 1st of each month
|
|
26
|
+
return day.getDate() === 1
|
|
27
|
+
? day.toLocaleDateString("en-US", { month: "short" })
|
|
28
|
+
: "";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const GanttTimelineHeader = ({ days, monthSpans, }) => {
|
|
32
|
+
const { theme, dayWidth, zoom } = useGanttContext();
|
|
33
|
+
const totalWidth = days.length * dayWidth;
|
|
34
|
+
const today = new Date();
|
|
35
|
+
today.setHours(0, 0, 0, 0);
|
|
36
|
+
return (jsxs("div", { className: cn(theme.timelineHeaderStyle), style: { width: totalWidth }, children: [jsx("div", { className: "flex", style: { height: 28 }, children: monthSpans.map((span) => (jsx("div", { className: cn(theme.timelineMonthStyle), style: { width: span.span * dayWidth }, children: span.label }, `${span.label}-${span.startIndex}`))) }), jsx("div", { className: "flex", style: { height: 28 }, children: days.map((day, i) => {
|
|
37
|
+
const isToday = isSameDay(day, today);
|
|
38
|
+
const weekend = isWeekend(day);
|
|
39
|
+
return (jsx("div", { className: cn(theme.timelineDayStyle, weekend && "bg-[var(--color-background-secondary)]/50", isToday && "font-semibold text-[var(--color-primary)]"), style: { width: dayWidth }, children: getDayLabel(day, zoom) }, i));
|
|
40
|
+
}) })] }));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { GanttTimelineHeader };
|