@flikk/ui 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ai/ApprovalCard/ApprovalCard.js +2 -2
- package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +173 -13
- package/dist/components/ai/PromptInput/PromptInput.theme.js +1 -0
- package/dist/components/ai/PromptInput/PromptInput.types.d.ts +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +2 -2
- package/dist/components/core/Alert/Alert.js +2 -2
- package/dist/components/core/Alert/Alert.types.d.ts +2 -2
- 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/Badge/Badge.js +11 -9
- package/dist/components/core/Badge/Badge.theme.js +13 -14
- package/dist/components/core/Badge/Badge.types.d.ts +6 -1
- package/dist/components/core/Button/Button.theme.js +8 -9
- package/dist/components/core/Calendar/Calendar.theme.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 +4 -4
- package/dist/components/core/Card/Card.types.d.ts +5 -20
- package/dist/components/core/Card/CardSubtitle.d.ts +3 -0
- package/dist/components/core/Card/CardSubtitle.js +11 -0
- 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 +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +1 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- 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.js +1 -1
- package/dist/components/core/Drawer/Drawer.types.d.ts +21 -4
- package/dist/components/core/Drawer/DrawerHeader.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerHeader.js +14 -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.types.d.ts +4 -4
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- 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/MenuItem/MenuItem.js +2 -2
- package/dist/components/core/MenuItem/MenuItem.theme.d.ts +1 -2
- package/dist/components/core/MenuItem/MenuItem.theme.js +7 -9
- 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 +5 -5
- package/dist/components/core/Modal/Modal.types.d.ts +4 -4
- 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/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/Popover/Popover.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +3 -3
- package/dist/components/core/Sidebar/Sidebar.js +1 -0
- 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/Toast/Toast.js +4 -4
- package/dist/components/core/Toast/Toast.theme.js +1 -1
- package/dist/components/core/Toast/Toast.types.d.ts +9 -9
- package/dist/components/core/Toast/useToast.js +6 -6
- package/dist/components/core/index.d.ts +2 -7
- package/dist/components/core/index.js +9 -19
- package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.js +1 -1
- package/dist/components/{core → data-display}/Feed/Feed.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 +28 -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 +2 -1
- package/dist/components/{core → data-display}/KPI/KPI.types.d.ts +5 -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 +9 -9
- package/dist/components/{core → data-display}/Metric/Metric.types.d.ts +6 -6
- package/dist/components/{core → data-display}/Table/Table.theme.js +2 -2
- package/dist/components/{core → data-display}/Table/TableActions.js +8 -8
- package/dist/components/{core → data-display}/Table/TableColumnManager.js +4 -4
- package/dist/components/{core → data-display}/Table/TableFilter.js +3 -3
- 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 +1 -1
- package/dist/components/data-display/index.d.ts +7 -0
- package/dist/components/data-display/index.js +20 -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/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 +24 -0
- package/dist/components/effects/index.js +12 -0
- package/dist/components/forms/Checkbox/Checkbox.js +3 -3
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -5
- package/dist/components/forms/ColorPicker/ColorPicker.theme.js +2 -2
- 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 +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +78 -0
- package/dist/components/forms/InputOTP/InputOTP.theme.js +1 -1
- package/dist/components/forms/Mention/Mention.d.ts +3 -0
- package/dist/components/forms/Mention/Mention.js +410 -0
- package/dist/components/forms/Mention/Mention.theme.d.ts +6 -0
- package/dist/components/forms/Mention/Mention.theme.js +56 -0
- package/dist/components/forms/Mention/Mention.types.d.ts +111 -0
- package/dist/components/forms/Mention/index.d.ts +3 -0
- package/dist/components/forms/Radio/Radio.js +8 -12
- package/dist/components/forms/Radio/Radio.theme.js +28 -5
- 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 +34 -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/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/index.d.ts +13 -0
- 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/index.d.ts +2 -0
- package/dist/index.js +208 -167
- package/dist/styles.css +1 -1
- package/dist/utils/dateUtils.d.ts +30 -0
- package/dist/utils/dateUtils.js +58 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +9 -2
- package/dist/components/core/Card/CardDescription.d.ts +0 -3
- package/dist/components/core/Card/CardDescription.js +0 -11
- 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.theme.js +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/TableActionsMenu.js +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/TableHeader.js +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.theme.js +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,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-sm font-medium", children: "No tasks to display" }), jsx("div", { className: "text-xs 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 };
|
|
@@ -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-xs 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-xs 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-xs 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 };
|