@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,29 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { CalendarIcon, PlusIcon } from '@heroicons/react/24/outline';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { useGanttContext } from './GanttChart.js';
|
|
5
|
+
import { Segmented } from '../../core/Segmented/Segmented.js';
|
|
6
|
+
import { Button } from '../../core/Button/Button.js';
|
|
7
|
+
import 'react';
|
|
8
|
+
import { Checkbox } from '../../forms/Checkbox/Checkbox.js';
|
|
9
|
+
|
|
10
|
+
const ZOOM_OPTIONS = [
|
|
11
|
+
{ value: "day", label: "Day" },
|
|
12
|
+
{ value: "week", label: "Week" },
|
|
13
|
+
{ value: "quarter", label: "Quarter" },
|
|
14
|
+
{ value: "month", label: "Month" },
|
|
15
|
+
{ value: "year", label: "Year" },
|
|
16
|
+
];
|
|
17
|
+
const GanttToolbar = () => {
|
|
18
|
+
const { theme, zoom, setZoom, hideCompleted, setHideCompleted, onGroupAdd, todayOffset, dayWidth, readonly, } = useGanttContext();
|
|
19
|
+
const handleScrollToToday = () => {
|
|
20
|
+
const container = document.querySelector("[data-gantt-chart-scroll]");
|
|
21
|
+
if (!container || todayOffset === null)
|
|
22
|
+
return;
|
|
23
|
+
const targetScroll = todayOffset * dayWidth - container.clientWidth / 2;
|
|
24
|
+
container.scrollTo({ left: targetScroll, behavior: "smooth" });
|
|
25
|
+
};
|
|
26
|
+
return (jsxs("div", { className: cn(theme.toolbarStyle), children: [jsxs("div", { className: "flex items-center gap-3", children: [todayOffset !== null && (jsxs(Button, { variant: "outline", color: "neutral", size: "sm", onClick: handleScrollToToday, children: [jsx(CalendarIcon, { className: "size-4" }), "Today"] })), jsx(Segmented, { value: zoom, onChange: (val) => setZoom(val), size: "sm", children: ZOOM_OPTIONS.map((opt) => (jsx(Segmented.Item, { value: opt.value, children: opt.label }, opt.value))) }), jsx(Checkbox, { id: "gantt-hide-completed", name: "hideCompleted", value: "hideCompleted", checked: hideCompleted, onChange: (checked) => setHideCompleted(checked), label: "Hide completed", size: "sm" })] }), jsx("div", { className: "flex items-center gap-2", children: onGroupAdd && !readonly && (jsxs(Button, { variant: "ghost", size: "sm", onClick: onGroupAdd, children: [jsx(PlusIcon, { className: "size-3.5" }), "Add group"] })) })] }));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { GanttToolbar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GanttTask, GanttZoom } from "../GanttChart.types";
|
|
2
|
+
import type { MonthSpan } from "../GanttChart.utils";
|
|
3
|
+
export interface UseGanttDatesResult {
|
|
4
|
+
rangeStart: Date;
|
|
5
|
+
rangeEnd: Date;
|
|
6
|
+
days: Date[];
|
|
7
|
+
monthSpans: MonthSpan[];
|
|
8
|
+
totalDays: number;
|
|
9
|
+
dayWidth: number;
|
|
10
|
+
todayOffset: number | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function useGanttDates(tasks: GanttTask[], zoom: GanttZoom, startDate?: Date | string, endDate?: Date | string): UseGanttDatesResult;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { DAY_WIDTHS } from '../GanttChart.types.js';
|
|
3
|
+
import { autoDateRange, generateDayColumns, generateMonthSpans, getDayOffset } from '../GanttChart.utils.js';
|
|
4
|
+
import { toDate, isSameDay } from '../../../../utils/dateUtils.js';
|
|
5
|
+
|
|
6
|
+
function useGanttDates(tasks, zoom, startDate, endDate) {
|
|
7
|
+
return useMemo(() => {
|
|
8
|
+
const auto = autoDateRange(tasks);
|
|
9
|
+
const rangeStart = startDate ? toDate(startDate) : auto.start;
|
|
10
|
+
const rangeEnd = endDate ? toDate(endDate) : auto.end;
|
|
11
|
+
const days = generateDayColumns(rangeStart, rangeEnd);
|
|
12
|
+
const monthSpans = generateMonthSpans(days);
|
|
13
|
+
const totalDays = days.length;
|
|
14
|
+
const dayWidth = DAY_WIDTHS[zoom];
|
|
15
|
+
const today = new Date();
|
|
16
|
+
today.setHours(0, 0, 0, 0);
|
|
17
|
+
const todayInRange = days.some((d) => isSameDay(d, today));
|
|
18
|
+
const todayOffset = todayInRange
|
|
19
|
+
? getDayOffset(today, rangeStart)
|
|
20
|
+
: null;
|
|
21
|
+
return { rangeStart, rangeEnd, days, monthSpans, totalDays, dayWidth, todayOffset };
|
|
22
|
+
}, [tasks, zoom, startDate, endDate]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { useGanttDates };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type DragMode = "move" | "resize-left" | "resize-right" | "progress";
|
|
3
|
+
export interface DragResult {
|
|
4
|
+
mode: DragMode;
|
|
5
|
+
daysDelta: number;
|
|
6
|
+
newProgress: number;
|
|
7
|
+
}
|
|
8
|
+
interface UseGanttDragOptions {
|
|
9
|
+
dayWidth: number;
|
|
10
|
+
mode: DragMode;
|
|
11
|
+
barWidthPx: number;
|
|
12
|
+
originalProgress: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onDragEnd: (result: DragResult) => void;
|
|
15
|
+
onDragStateChange?: (isDragging: boolean, deltaX: number) => void;
|
|
16
|
+
}
|
|
17
|
+
interface UseGanttDragReturn {
|
|
18
|
+
isDragging: boolean;
|
|
19
|
+
didDrag: boolean;
|
|
20
|
+
dragDeltaX: number;
|
|
21
|
+
dragProgress: number;
|
|
22
|
+
handlePointerDown: (e: React.PointerEvent) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function useGanttDrag({ dayWidth, mode, barWidthPx, originalProgress, disabled, onDragEnd, onDragStateChange, }: UseGanttDragOptions): UseGanttDragReturn;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Constants
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
const DRAG_THRESHOLD = 3; // px dead zone before drag activates
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Hook
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
function useGanttDrag({ dayWidth, mode, barWidthPx, originalProgress, disabled = false, onDragEnd, onDragStateChange, }) {
|
|
11
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
12
|
+
const [dragDeltaX, setDragDeltaX] = useState(0);
|
|
13
|
+
const [dragProgress, setDragProgress] = useState(originalProgress);
|
|
14
|
+
const didDragRef = useRef(false);
|
|
15
|
+
const startXRef = useRef(0);
|
|
16
|
+
const activatedRef = useRef(false);
|
|
17
|
+
const cancelledRef = useRef(false);
|
|
18
|
+
const cleanupRef = useRef(null);
|
|
19
|
+
// Reset didDrag after a tick so click handler can read it
|
|
20
|
+
const [didDrag, setDidDrag] = useState(false);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (didDrag) {
|
|
23
|
+
const timer = setTimeout(() => setDidDrag(false), 0);
|
|
24
|
+
return () => clearTimeout(timer);
|
|
25
|
+
}
|
|
26
|
+
}, [didDrag]);
|
|
27
|
+
const handlePointerDown = useCallback((e) => {
|
|
28
|
+
if (disabled || e.button !== 0)
|
|
29
|
+
return;
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
e.stopPropagation();
|
|
32
|
+
startXRef.current = e.clientX;
|
|
33
|
+
activatedRef.current = false;
|
|
34
|
+
cancelledRef.current = false;
|
|
35
|
+
didDragRef.current = false;
|
|
36
|
+
const onPointerMove = (ev) => {
|
|
37
|
+
var _a;
|
|
38
|
+
if (cancelledRef.current)
|
|
39
|
+
return;
|
|
40
|
+
const rawDelta = ev.clientX - startXRef.current;
|
|
41
|
+
// Dead zone: don't activate drag until threshold crossed
|
|
42
|
+
if (!activatedRef.current) {
|
|
43
|
+
if (Math.abs(rawDelta) < DRAG_THRESHOLD)
|
|
44
|
+
return;
|
|
45
|
+
activatedRef.current = true;
|
|
46
|
+
didDragRef.current = true;
|
|
47
|
+
setIsDragging(true);
|
|
48
|
+
}
|
|
49
|
+
if (mode === "progress") {
|
|
50
|
+
// Progress: map delta to 0-100 range
|
|
51
|
+
const progressDelta = barWidthPx > 0 ? (rawDelta / barWidthPx) * 100 : 0;
|
|
52
|
+
const newProgress = Math.round(Math.max(0, Math.min(100, originalProgress + progressDelta)));
|
|
53
|
+
setDragProgress(newProgress);
|
|
54
|
+
setDragDeltaX(rawDelta);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Move/resize: snap to day grid
|
|
58
|
+
const snappedDelta = Math.round(rawDelta / dayWidth) * dayWidth;
|
|
59
|
+
setDragDeltaX(snappedDelta);
|
|
60
|
+
(_a = onDragStateChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onDragStateChangeRef, true, snappedDelta);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const onPointerUp = () => {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
66
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
67
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
68
|
+
cleanupRef.current = null;
|
|
69
|
+
if (cancelledRef.current) {
|
|
70
|
+
setIsDragging(false);
|
|
71
|
+
setDragDeltaX(0);
|
|
72
|
+
setDragProgress(originalProgress);
|
|
73
|
+
(_a = onDragStateChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onDragStateChangeRef, false, 0);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (activatedRef.current) {
|
|
77
|
+
setDidDrag(true);
|
|
78
|
+
const finalDelta = dragDeltaXRef.current;
|
|
79
|
+
const daysDelta = Math.round(finalDelta / dayWidth);
|
|
80
|
+
if (mode === "progress") {
|
|
81
|
+
onDragEnd({
|
|
82
|
+
mode,
|
|
83
|
+
daysDelta: 0,
|
|
84
|
+
newProgress: dragProgressRef.current,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
else if (daysDelta !== 0) {
|
|
88
|
+
onDragEnd({ mode, daysDelta, newProgress: originalProgress });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
(_b = onDragStateChangeRef.current) === null || _b === void 0 ? void 0 : _b.call(onDragStateChangeRef, false, 0);
|
|
92
|
+
setIsDragging(false);
|
|
93
|
+
setDragDeltaX(0);
|
|
94
|
+
setDragProgress(originalProgress);
|
|
95
|
+
};
|
|
96
|
+
const onKeyDown = (ev) => {
|
|
97
|
+
var _a;
|
|
98
|
+
if (ev.key === "Escape") {
|
|
99
|
+
cancelledRef.current = true;
|
|
100
|
+
setIsDragging(false);
|
|
101
|
+
setDragDeltaX(0);
|
|
102
|
+
setDragProgress(originalProgress);
|
|
103
|
+
(_a = onDragStateChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onDragStateChangeRef, false, 0);
|
|
104
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
105
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
106
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
107
|
+
cleanupRef.current = null;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
document.addEventListener("pointermove", onPointerMove);
|
|
111
|
+
document.addEventListener("pointerup", onPointerUp);
|
|
112
|
+
document.addEventListener("keydown", onKeyDown);
|
|
113
|
+
// Store cleanup so useEffect can remove listeners if component unmounts mid-drag
|
|
114
|
+
cleanupRef.current = () => {
|
|
115
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
116
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
117
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
118
|
+
cleanupRef.current = null;
|
|
119
|
+
};
|
|
120
|
+
}, [disabled, dayWidth, mode, barWidthPx, originalProgress, onDragEnd]);
|
|
121
|
+
// Remove dangling listeners on unmount
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
return () => {
|
|
124
|
+
var _a;
|
|
125
|
+
(_a = cleanupRef.current) === null || _a === void 0 ? void 0 : _a.call(cleanupRef);
|
|
126
|
+
};
|
|
127
|
+
}, []);
|
|
128
|
+
// Keep refs in sync with state/callbacks so closures read current values
|
|
129
|
+
const dragDeltaXRef = useRef(dragDeltaX);
|
|
130
|
+
dragDeltaXRef.current = dragDeltaX;
|
|
131
|
+
const dragProgressRef = useRef(dragProgress);
|
|
132
|
+
dragProgressRef.current = dragProgress;
|
|
133
|
+
const onDragStateChangeRef = useRef(onDragStateChange);
|
|
134
|
+
onDragStateChangeRef.current = onDragStateChange;
|
|
135
|
+
return {
|
|
136
|
+
isDragging,
|
|
137
|
+
didDrag,
|
|
138
|
+
dragDeltaX,
|
|
139
|
+
dragProgress,
|
|
140
|
+
handlePointerDown,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { useGanttDrag };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { computeGroupSummary } from '../GanttChart.utils.js';
|
|
3
|
+
|
|
4
|
+
function useGanttLayout(groups, tasks, collapsedGroups, hideCompleted) {
|
|
5
|
+
return useMemo(() => {
|
|
6
|
+
const sorted = [...groups].sort((a, b) => { var _a, _b; return ((_a = a.order) !== null && _a !== void 0 ? _a : 0) - ((_b = b.order) !== null && _b !== void 0 ? _b : 0); });
|
|
7
|
+
const rows = [];
|
|
8
|
+
for (const group of sorted) {
|
|
9
|
+
const groupTasks = tasks.filter((t) => t.groupId === group.id);
|
|
10
|
+
const visibleTasks = hideCompleted
|
|
11
|
+
? groupTasks.filter((t) => !t.completed)
|
|
12
|
+
: groupTasks;
|
|
13
|
+
const summary = computeGroupSummary(group, groupTasks);
|
|
14
|
+
rows.push({
|
|
15
|
+
type: "group",
|
|
16
|
+
group,
|
|
17
|
+
taskCount: visibleTasks.length,
|
|
18
|
+
completedCount: summary.completedCount,
|
|
19
|
+
earliestStart: summary.earliestStart,
|
|
20
|
+
latestEnd: summary.latestEnd,
|
|
21
|
+
});
|
|
22
|
+
const isCollapsed = collapsedGroups.includes(group.id);
|
|
23
|
+
if (!isCollapsed) {
|
|
24
|
+
for (const task of visibleTasks) {
|
|
25
|
+
rows.push({ type: "task", task, group });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return rows;
|
|
30
|
+
}, [groups, tasks, collapsedGroups, hideCompleted]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { useGanttLayout };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useRef, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
function useGanttScrollSync() {
|
|
4
|
+
const tableRef = useRef(null);
|
|
5
|
+
const chartRef = useRef(null);
|
|
6
|
+
const isSyncing = useRef(false);
|
|
7
|
+
const handleTableScroll = useCallback(() => {
|
|
8
|
+
if (isSyncing.current)
|
|
9
|
+
return;
|
|
10
|
+
isSyncing.current = true;
|
|
11
|
+
requestAnimationFrame(() => {
|
|
12
|
+
if (tableRef.current && chartRef.current) {
|
|
13
|
+
chartRef.current.scrollTop = tableRef.current.scrollTop;
|
|
14
|
+
}
|
|
15
|
+
isSyncing.current = false;
|
|
16
|
+
});
|
|
17
|
+
}, []);
|
|
18
|
+
const handleChartScroll = useCallback(() => {
|
|
19
|
+
if (isSyncing.current)
|
|
20
|
+
return;
|
|
21
|
+
isSyncing.current = true;
|
|
22
|
+
requestAnimationFrame(() => {
|
|
23
|
+
if (chartRef.current && tableRef.current) {
|
|
24
|
+
tableRef.current.scrollTop = chartRef.current.scrollTop;
|
|
25
|
+
}
|
|
26
|
+
isSyncing.current = false;
|
|
27
|
+
});
|
|
28
|
+
}, []);
|
|
29
|
+
return { tableRef, chartRef, handleTableScroll, handleChartScroll };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { useGanttScrollSync };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { useMemo } from 'react';
|
|
3
|
+
import { motion } from 'motion/react';
|
|
3
4
|
import { ArrowUpRightIcon, ArrowDownRightIcon } from '@heroicons/react/20/solid';
|
|
4
5
|
import { cn } from '../../../utils/cn.js';
|
|
5
6
|
import { kpiTheme } from './KPI.theme.js';
|
|
6
7
|
|
|
7
|
-
const KPI = React__default.forwardRef(({ value, label, trend, trendLabel, progress, barCount = 24,
|
|
8
|
+
const KPI = React__default.forwardRef(({ value, label, trend, trendLabel, progress, barCount = 24, subtitle, icon, size = "md", color = "primary", className, theme: customTheme = {}, ...props }, ref) => {
|
|
8
9
|
const theme = useMemo(() => ({
|
|
9
10
|
...kpiTheme,
|
|
10
11
|
...customTheme,
|
|
@@ -33,15 +34,16 @@ const KPI = React__default.forwardRef(({ value, label, trend, trendLabel, progre
|
|
|
33
34
|
const barSize = kpiTheme.barSizes[size];
|
|
34
35
|
return (jsxs("div", { ref: ref, className: cn(theme.baseStyle, className), ...props, children: [jsxs("div", { className: "flex items-start justify-between", children: [jsxs("div", { className: "flex items-baseline gap-2", children: [jsx("span", { className: cn(theme.valueSizes[size]), children: value }), label && (jsxs("span", { className: cn(theme.labelStyle, theme.labelSizes[size]), children: [icon && (jsx("span", { className: "inline-flex items-center mr-1", children: icon })), label] }))] }), formattedTrend && trendDirection && (jsxs("span", { className: cn("inline-flex items-center gap-0.5 font-medium", theme.trendSizes[size], trendDirection === "up" && theme.trendPositive, trendDirection === "down" && theme.trendNegative, trendDirection === "neutral" && theme.trendNeutral), children: [formattedTrend, trendDirection === "up" && jsx(ArrowUpRightIcon, { className: "size-4" }), trendDirection === "down" && jsx(ArrowDownRightIcon, { className: "size-4" })] }))] }), progress !== undefined && (jsx("div", { className: cn("flex items-end", barSize.gap), role: "img", "aria-label": `Progress: ${progress}%`, children: Array.from({ length: barCount }, (_, i) => {
|
|
35
36
|
const isFilled = i < filledBars;
|
|
36
|
-
// Fade the last 2-3 filled bars for a smooth transition
|
|
37
37
|
const fadeDistance = filledBars - i;
|
|
38
|
-
const
|
|
38
|
+
const fillOpacity = isFilled && fadeDistance <= 3
|
|
39
39
|
? 0.4 + (fadeDistance / 3) * 0.6
|
|
40
|
-
:
|
|
41
|
-
return (jsx("div", { className: cn("rounded-sm flex-1", barSize.height, isFilled
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
: 1;
|
|
41
|
+
return (jsx("div", { className: cn("relative rounded-sm flex-1", barSize.height, theme.barEmptyColor), children: isFilled && (jsx(motion.div, { className: cn("absolute inset-0 rounded-sm", theme.barFilledColors[color]), initial: { opacity: 0 }, animate: { opacity: fillOpacity }, transition: {
|
|
42
|
+
duration: 0.25,
|
|
43
|
+
ease: "easeOut",
|
|
44
|
+
delay: i * 0.03,
|
|
45
|
+
} })) }, i));
|
|
46
|
+
}) })), subtitle && (jsx("span", { className: cn(theme.subtitleStyle, size === "sm" ? "text-sm" : "text-base"), children: subtitle }))] }));
|
|
45
47
|
});
|
|
46
48
|
KPI.displayName = "KPI";
|
|
47
49
|
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
+
import { semanticBgColors } from '../../../utils/colorUtils.js';
|
|
2
|
+
|
|
1
3
|
const kpiTheme = {
|
|
2
4
|
baseStyle: "flex flex-col gap-3",
|
|
3
5
|
valueSizes: {
|
|
4
|
-
sm: "text-
|
|
6
|
+
sm: "text-2xl font-bold text-[var(--color-text-primary)]",
|
|
5
7
|
md: "text-3xl font-bold text-[var(--color-text-primary)]",
|
|
6
8
|
lg: "text-4xl font-bold text-[var(--color-text-primary)]",
|
|
7
9
|
},
|
|
8
10
|
labelStyle: "text-[var(--color-text-muted)]",
|
|
9
11
|
labelSizes: {
|
|
10
|
-
sm: "text-
|
|
11
|
-
md: "text-
|
|
12
|
-
lg: "text-
|
|
12
|
+
sm: "text-sm",
|
|
13
|
+
md: "text-base",
|
|
14
|
+
lg: "text-lg",
|
|
13
15
|
},
|
|
14
16
|
trendPositive: "text-[var(--color-success)]",
|
|
15
17
|
trendNegative: "text-[var(--color-danger)]",
|
|
16
18
|
trendNeutral: "text-[var(--color-text-muted)]",
|
|
17
19
|
trendSizes: {
|
|
18
|
-
sm: "text-
|
|
19
|
-
md: "text-
|
|
20
|
-
lg: "text-
|
|
20
|
+
sm: "text-sm",
|
|
21
|
+
md: "text-base",
|
|
22
|
+
lg: "text-lg",
|
|
21
23
|
},
|
|
22
24
|
barFilledColors: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
warning: "bg-[var(--color-warning)]",
|
|
26
|
-
danger: "bg-[var(--color-danger)]",
|
|
25
|
+
...semanticBgColors,
|
|
26
|
+
neutral: "bg-[var(--color-text-secondary)]",
|
|
27
27
|
},
|
|
28
28
|
barEmptyColor: "bg-[var(--color-background-tertiary)]",
|
|
29
29
|
barSizes: {
|
|
@@ -31,7 +31,7 @@ const kpiTheme = {
|
|
|
31
31
|
md: { height: "h-6", width: "w-[3px]", gap: "gap-[3px]" },
|
|
32
32
|
lg: { height: "h-8", width: "w-1", gap: "gap-1" },
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
subtitleStyle: "text-[var(--color-text-muted)]",
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export { kpiTheme };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode, HTMLAttributes } from "react";
|
|
2
|
+
import { SemanticColor } from "../../../utils/colorUtils";
|
|
2
3
|
export type KPISize = "sm" | "md" | "lg";
|
|
3
|
-
export type KPIColor =
|
|
4
|
+
export type KPIColor = SemanticColor;
|
|
4
5
|
export interface KPITheme {
|
|
5
6
|
baseStyle: string;
|
|
6
7
|
valueSizes: Record<KPISize, string>;
|
|
@@ -17,7 +18,7 @@ export interface KPITheme {
|
|
|
17
18
|
width: string;
|
|
18
19
|
gap: string;
|
|
19
20
|
}>;
|
|
20
|
-
|
|
21
|
+
subtitleStyle: string;
|
|
21
22
|
}
|
|
22
23
|
export interface KPIThemeOverrides {
|
|
23
24
|
baseStyle?: string;
|
|
@@ -27,7 +28,7 @@ export interface KPIThemeOverrides {
|
|
|
27
28
|
trendNegative?: string;
|
|
28
29
|
barFilledColors?: Partial<Record<KPIColor, string>>;
|
|
29
30
|
barEmptyColor?: string;
|
|
30
|
-
|
|
31
|
+
subtitleStyle?: string;
|
|
31
32
|
}
|
|
32
33
|
export interface KPIProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
33
34
|
/**
|
|
@@ -56,9 +57,9 @@ export interface KPIProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">
|
|
|
56
57
|
*/
|
|
57
58
|
barCount?: number;
|
|
58
59
|
/**
|
|
59
|
-
*
|
|
60
|
+
* Subtitle text below the bars (e.g. "Compared to last month")
|
|
60
61
|
*/
|
|
61
|
-
|
|
62
|
+
subtitle?: string;
|
|
62
63
|
/**
|
|
63
64
|
* Icon to display before the label.
|
|
64
65
|
*/
|
|
@@ -2,21 +2,18 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import { metricTheme } from './Metric.theme.js';
|
|
5
|
-
import { Badge } from '../Badge/Badge.js';
|
|
6
5
|
import { ArrowTrendingUpIcon, ArrowTrendingDownIcon } from '@heroicons/react/24/outline';
|
|
7
6
|
|
|
8
|
-
const Metric = React__default.forwardRef(({ value, label,
|
|
7
|
+
const Metric = React__default.forwardRef(({ value, label, subtitle, trendValue, trendDirection = "up", trendChart, size = "md", variant = "filled", color = "primary", icon, className, ...props }, ref) => {
|
|
9
8
|
var _a;
|
|
10
9
|
const trendIcon = trendDirection === "up" ? (jsx(ArrowTrendingUpIcon, { className: "size-3.5", strokeWidth: 2.5 })) : (jsx(ArrowTrendingDownIcon, { className: "size-3.5", strokeWidth: 2.5 }));
|
|
11
10
|
const sizeStyles = metricTheme.sizes[size];
|
|
12
11
|
const variantStyles = metricTheme.variants[variant];
|
|
13
12
|
const variantColorStyles = metricTheme.variantColors[variant] || "";
|
|
14
13
|
const iconStyles = ((_a = metricTheme.iconContainerVariantColors[variant]) === null || _a === void 0 ? void 0 : _a[color]) || "";
|
|
15
|
-
return (jsx("div", { ref: ref, className: cn(metricTheme.baseStyle, variantStyles, variantColorStyles, sizeStyles.container, className), "data-size": size, ...props, children: jsxs("div", { className: "flex flex-col gap-3 ", children: [jsxs("div", { className: cn("flex items-start gap-3", sizeStyles.contentPadding), children: [icon && (jsx("div", { className: cn(metricTheme.iconContainerStyle, iconStyles, sizeStyles.iconContainer), children: icon })), jsxs("div", { className: "flex flex-col flex-1", children: [jsx("div", { className: cn(metricTheme.labelStyle, sizeStyles.label), children: label }), jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: cn(metricTheme.valueStyle, sizeStyles.value), children: value }), trendValue && (jsxs("div", { className: "flex items-center
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
? "text-[var(--color-success)]"
|
|
19
|
-
: "text-[var(--color-danger)]"), children: trendValue })] }))] }), description && (jsx("div", { className: cn(metricTheme.descriptionStyle, sizeStyles.description), children: description }))] })] }), trendChart && (jsx("div", { className: "w-full h-12 flex-shrink-0 -mt-4", children: trendChart }))] }) }));
|
|
14
|
+
return (jsx("div", { ref: ref, className: cn(metricTheme.baseStyle, variantStyles, variantColorStyles, sizeStyles.container, className), "data-size": size, ...props, children: jsxs("div", { className: "flex flex-col gap-3 ", children: [jsxs("div", { className: cn("flex items-start gap-3", sizeStyles.contentPadding), children: [icon && (jsx("div", { className: cn(metricTheme.iconContainerStyle, iconStyles, sizeStyles.iconContainer), children: icon })), jsxs("div", { className: "flex flex-col flex-1", children: [jsx("div", { className: cn(metricTheme.labelStyle, sizeStyles.label), children: label }), jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: cn(metricTheme.valueStyle, sizeStyles.value), children: value }), trendValue && (jsxs("div", { className: cn("flex items-center w-fit gap-1 text-base font-medium", trendDirection === "up"
|
|
15
|
+
? "text-[var(--color-success)]"
|
|
16
|
+
: "text-[var(--color-danger)]"), children: [trendIcon, " ", trendValue] }))] }), subtitle && (jsx("div", { className: cn(metricTheme.subtitleStyle, sizeStyles.subtitle), children: subtitle }))] })] }), trendChart && (jsx("div", { className: "w-full h-12 flex-shrink-0 -mt-4", children: trendChart }))] }) }));
|
|
20
17
|
});
|
|
21
18
|
Metric.displayName = "Metric";
|
|
22
19
|
|
|
@@ -19,20 +19,24 @@ const metricTheme = {
|
|
|
19
19
|
iconContainerVariantColors: {
|
|
20
20
|
filled: {
|
|
21
21
|
neutral: "bg-white text-[var(--color-text-primary)] border border-[var(--color-border)] " +
|
|
22
|
-
"dark:bg-[var(--color-background-secondary)]
|
|
22
|
+
"dark:bg-[var(--color-background-secondary)]",
|
|
23
23
|
primary: "bg-white text-[var(--color-primary)] border border-[var(--color-border)] " +
|
|
24
|
-
"dark:bg-[var(--color-background-secondary)]
|
|
24
|
+
"dark:bg-[var(--color-background-secondary)]",
|
|
25
|
+
secondary: "bg-white text-[var(--color-secondary)] border border-[var(--color-border)] " +
|
|
26
|
+
"dark:bg-[var(--color-background-secondary)]",
|
|
25
27
|
success: "bg-white text-[var(--color-success)] border border-[var(--color-border)] " +
|
|
26
|
-
"dark:bg-[var(--color-background-secondary)]
|
|
28
|
+
"dark:bg-[var(--color-background-secondary)]",
|
|
27
29
|
warning: "bg-white text-[var(--color-warning)] border border-[var(--color-border)] " +
|
|
28
|
-
"dark:bg-[var(--color-background-secondary)]
|
|
30
|
+
"dark:bg-[var(--color-background-secondary)]",
|
|
29
31
|
danger: "bg-white text-[var(--color-danger)] border border-[var(--color-border)] " +
|
|
30
|
-
"dark:bg-[var(--color-background-secondary)]
|
|
32
|
+
"dark:bg-[var(--color-background-secondary)]",
|
|
31
33
|
},
|
|
32
34
|
glass: {
|
|
33
35
|
neutral: "glass-effect-1 !ring-0 text-[var(--color-text-primary)]",
|
|
34
36
|
primary: "glass-effect-2 !ring-0 shadow-lg shadow-blue-500/10 text-[var(--color-primary)] " +
|
|
35
37
|
"dark:text-[var(--color-primary-400)]",
|
|
38
|
+
secondary: "glass-effect-2 !ring-0 shadow-lg shadow-gray-500/10 text-[var(--color-secondary)] " +
|
|
39
|
+
"dark:text-[var(--color-secondary-400)]",
|
|
36
40
|
success: "glass-effect-2 !ring-0 shadow-lg shadow-green-500/10 text-[var(--color-success)] " +
|
|
37
41
|
"dark:text-[var(--color-success-400)]",
|
|
38
42
|
warning: "glass-effect-2 !ring-0 shadow-lg shadow-yellow-500/10 text-[var(--color-warning)] " +
|
|
@@ -47,31 +51,31 @@ const metricTheme = {
|
|
|
47
51
|
container: "", // Padding moved to content section
|
|
48
52
|
contentPadding: "p-3",
|
|
49
53
|
iconContainer: "size-10",
|
|
50
|
-
label: "text-
|
|
51
|
-
value: "text-
|
|
52
|
-
|
|
54
|
+
label: "text-sm",
|
|
55
|
+
value: "text-2xl",
|
|
56
|
+
subtitle: "text-sm mt-1",
|
|
53
57
|
},
|
|
54
58
|
md: {
|
|
55
59
|
container: "", // Padding moved to content section
|
|
56
60
|
contentPadding: "p-4",
|
|
57
61
|
iconContainer: "size-14",
|
|
58
|
-
label: "text-
|
|
62
|
+
label: "text-base",
|
|
59
63
|
value: "text-2xl",
|
|
60
|
-
|
|
64
|
+
subtitle: "text-sm mt-0.5",
|
|
61
65
|
},
|
|
62
66
|
lg: {
|
|
63
67
|
container: "", // Padding moved to content section
|
|
64
68
|
contentPadding: "p-5",
|
|
65
69
|
iconContainer: "size-16",
|
|
66
|
-
label: "text-
|
|
70
|
+
label: "text-lg",
|
|
67
71
|
value: "text-3xl",
|
|
68
|
-
|
|
72
|
+
subtitle: "text-base mt-1",
|
|
69
73
|
},
|
|
70
74
|
},
|
|
71
75
|
// Common element styles
|
|
72
76
|
labelStyle: "font-semibold text-[var(--color-text-secondary)] mb-1",
|
|
73
77
|
valueStyle: "font-bold text-[var(--color-text-primary)] tracking-tight",
|
|
74
|
-
|
|
78
|
+
subtitleStyle: "text-[var(--color-text-secondary)]/80",
|
|
75
79
|
iconContainerStyle: "rounded-full flex items-center justify-center flex-shrink-0 p-3.5",
|
|
76
80
|
};
|
|
77
81
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SemanticColor } from '../../../utils/colorUtils';
|
|
2
3
|
export type MetricSize = 'sm' | 'md' | 'lg';
|
|
3
|
-
export type MetricColor =
|
|
4
|
+
export type MetricColor = SemanticColor;
|
|
4
5
|
export type MetricVariant = 'filled' | 'glass';
|
|
5
6
|
export type TrendDirection = 'up' | 'down';
|
|
6
7
|
export interface MetricProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -13,9 +14,9 @@ export interface MetricProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
13
14
|
*/
|
|
14
15
|
label: string;
|
|
15
16
|
/**
|
|
16
|
-
* Optional
|
|
17
|
+
* Optional subtitle or secondary text
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
+
subtitle?: string;
|
|
19
20
|
/**
|
|
20
21
|
* Trend value to display (e.g., "+10.34%", "-5.2%")
|
|
21
22
|
* Also acts as boolean - if provided, trend badge is shown
|
|
@@ -65,11 +66,11 @@ export interface MetricTheme {
|
|
|
65
66
|
iconContainer: string;
|
|
66
67
|
label: string;
|
|
67
68
|
value: string;
|
|
68
|
-
|
|
69
|
+
subtitle: string;
|
|
69
70
|
}>;
|
|
70
71
|
labelStyle: string;
|
|
71
72
|
valueStyle: string;
|
|
72
|
-
|
|
73
|
+
subtitleStyle: string;
|
|
73
74
|
iconContainerStyle: string;
|
|
74
75
|
}
|
|
75
76
|
export interface MetricThemeOverrides {
|
|
@@ -83,10 +84,10 @@ export interface MetricThemeOverrides {
|
|
|
83
84
|
iconContainer: string;
|
|
84
85
|
label: string;
|
|
85
86
|
value: string;
|
|
86
|
-
|
|
87
|
+
subtitle: string;
|
|
87
88
|
}>>>;
|
|
88
89
|
labelStyle?: string;
|
|
89
90
|
valueStyle?: string;
|
|
90
|
-
|
|
91
|
+
subtitleStyle?: string;
|
|
91
92
|
iconContainerStyle?: string;
|
|
92
93
|
}
|
|
@@ -3,7 +3,7 @@ const tableTheme = {
|
|
|
3
3
|
// Uses border-separate so sticky cells keep their borders (border-collapse
|
|
4
4
|
// paints borders on the table grid, which sticky cells float above)
|
|
5
5
|
// Light: white background | Dark: neutral-900 background
|
|
6
|
-
baseStyle: "w-full border-separate border-spacing-0 text-
|
|
6
|
+
baseStyle: "w-full border-separate border-spacing-0 text-base " + "",
|
|
7
7
|
// Variant styles
|
|
8
8
|
// Each variant gets dark mode border colors and alternate row colors
|
|
9
9
|
variants: {
|
|
@@ -22,8 +22,8 @@ const tableTheme = {
|
|
|
22
22
|
},
|
|
23
23
|
// Header styles
|
|
24
24
|
// Light: primary text, light border | Dark: neutral-200 text, neutral-700 border
|
|
25
|
-
headerStyle: "text-left font-
|
|
26
|
-
"text-[var(--color-text-
|
|
25
|
+
headerStyle: "text-left font-semibold sticky top-0 border-b first:pl-4 last:pr-4 " +
|
|
26
|
+
"text-[var(--color-text-secondary)]/80 text-base border-[var(--color-border)] ",
|
|
27
27
|
// Cell styles — borders on cells (not rows) so sticky columns keep them
|
|
28
28
|
// Light: primary text | Dark: neutral-300 text
|
|
29
29
|
cellStyle: "border-b border-b-[var(--color-border)] first:pl-4 last:pr-4 " +
|
|
@@ -46,7 +46,7 @@ const tableTheme = {
|
|
|
46
46
|
"dark:shadow-[var(--color-neutral-900)]/50",
|
|
47
47
|
// Utility controls - Column manager button
|
|
48
48
|
// Light: white bg with light border | Dark: neutral-800 bg with neutral-600 border
|
|
49
|
-
columnManagerButton: "inline-flex items-center gap-2 rounded-[calc(var(--radius-base)*0.75)] px-3 py-2 text-
|
|
49
|
+
columnManagerButton: "inline-flex items-center gap-2 rounded-[calc(var(--radius-base)*0.75)] px-3 py-2 text-base font-medium " +
|
|
50
50
|
"focus:outline-none focus:ring-2 focus:ring-[var(--color-primary-500)] focus:ring-offset-2 " +
|
|
51
51
|
"dark:focus:ring-offset-[var(--color-neutral-900)] " +
|
|
52
52
|
"bg-white border border-[var(--color-neutral-300)] text-[var(--color-text-primary)] hover:bg-[var(--color-neutral-50)] " +
|