@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
|
@@ -54,6 +54,25 @@ const cursorPulse = {
|
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Inline token fade-in animation
|
|
59
|
+
* Used for word-by-word animation inside markdown prose elements
|
|
60
|
+
* No y-movement to prevent layout jitter in inline text
|
|
61
|
+
*/
|
|
62
|
+
const inlineTokenFadeIn = {
|
|
63
|
+
hidden: {
|
|
64
|
+
opacity: 0,
|
|
65
|
+
filter: 'blur(3px)',
|
|
66
|
+
},
|
|
67
|
+
visible: {
|
|
68
|
+
opacity: 1,
|
|
69
|
+
filter: 'blur(0px)',
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
const inlineTokenTransition = {
|
|
73
|
+
duration: 0.3,
|
|
74
|
+
ease: [0.25, 0.4, 0.55, 1],
|
|
75
|
+
};
|
|
57
76
|
/**
|
|
58
77
|
* Container animation for staggered children
|
|
59
78
|
*/
|
|
@@ -65,4 +84,4 @@ const staggerContainer = {
|
|
|
65
84
|
},
|
|
66
85
|
};
|
|
67
86
|
|
|
68
|
-
export { blockSlideIn, blockTransition, cursorPulse, staggerContainer, tokenFadeIn, tokenTransition };
|
|
87
|
+
export { blockSlideIn, blockTransition, cursorPulse, inlineTokenFadeIn, inlineTokenTransition, staggerContainer, tokenFadeIn, tokenTransition };
|
|
@@ -32,7 +32,7 @@ onToken, onComplete, onError, onStart, onAbort,
|
|
|
32
32
|
// Display options
|
|
33
33
|
typingSpeed = 100, enableTypewriter = true, enableMarkdown = true, markdownOptions,
|
|
34
34
|
// Animation
|
|
35
|
-
animated = true, showCursor = true,
|
|
35
|
+
animated = true, showCursor = true, animateLastN = 6,
|
|
36
36
|
// Message component props
|
|
37
37
|
role = 'assistant', avatar, showTimestamp = true, showActions = true, onCopy, onRegenerate,
|
|
38
38
|
// Error handling
|
|
@@ -65,7 +65,7 @@ className, }) => {
|
|
|
65
65
|
}
|
|
66
66
|
else if (enableMarkdown) {
|
|
67
67
|
// Render markdown with block-level slide-in animations and streaming cursor
|
|
68
|
-
messageContent = (jsx(MarkdownRenderer, { content: accumulatedText, options: markdownOptions, isStreaming: isStreaming, animated: animated, showCursor: showCursor }));
|
|
68
|
+
messageContent = (jsx(MarkdownRenderer, { content: accumulatedText, options: markdownOptions, isStreaming: isStreaming, animated: animated, showCursor: showCursor, animateLastN: animateLastN }));
|
|
69
69
|
}
|
|
70
70
|
else if (isStreaming) {
|
|
71
71
|
// During streaming without markdown: use per-token fade-in animation
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const streamingResponseTheme = {
|
|
2
2
|
errorContainerStyle: "flex items-start gap-3 rounded-[var(--radius-base)] border border-[var(--color-danger-200)] bg-[var(--color-danger-50)] px-4 py-3",
|
|
3
|
-
errorTitleStyle: "text-
|
|
4
|
-
errorMessageStyle: "text-
|
|
5
|
-
errorRetryButtonStyle: "mt-2 text-
|
|
6
|
-
loadingContainerStyle: "flex items-center gap-2 text-[var(--color-text-placeholder)] text-
|
|
3
|
+
errorTitleStyle: "text-base font-medium text-[var(--color-danger)]",
|
|
4
|
+
errorMessageStyle: "text-base text-[var(--color-text-secondary)] mt-1",
|
|
5
|
+
errorRetryButtonStyle: "mt-2 text-base font-medium text-[var(--color-danger)] hover:text-[var(--color-danger-700)] transition-colors",
|
|
6
|
+
loadingContainerStyle: "flex items-center gap-2 text-[var(--color-text-placeholder)] text-base",
|
|
7
7
|
loadingDotStyle: "w-1.5 h-1.5 rounded-full bg-current animate-pulse",
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -63,6 +63,8 @@ export interface StreamingResponseProps {
|
|
|
63
63
|
animated?: boolean;
|
|
64
64
|
/** Show blinking cursor while streaming (default: true) */
|
|
65
65
|
showCursor?: boolean;
|
|
66
|
+
/** Number of recent words to animate during streaming (default: 6) */
|
|
67
|
+
animateLastN?: number;
|
|
66
68
|
/** Message role (default: 'assistant') */
|
|
67
69
|
role?: MessageRole;
|
|
68
70
|
/** Avatar configuration */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordAnimationContext
|
|
3
|
+
* Provides a global word counter for word-by-word fade-in animation
|
|
4
|
+
* inside markdown-rendered content. Works like AnimatedText but across
|
|
5
|
+
* all markdown elements (paragraphs, headings, lists, blockquotes, etc.).
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
interface WordAnimationContextValue {
|
|
9
|
+
/** Process children of a prose element, animating recent words */
|
|
10
|
+
processChildren: (children: React.ReactNode) => React.ReactNode;
|
|
11
|
+
/** Count words in children without animating (for code blocks, tables, etc.) */
|
|
12
|
+
skipChildren: (children: React.ReactNode) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const useWordAnimation: () => WordAnimationContextValue | null;
|
|
15
|
+
export interface WordAnimationProviderProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/** Full markdown content string — used to compute total word count */
|
|
18
|
+
content: string;
|
|
19
|
+
/** Whether animation is active */
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
/** Number of recent words to animate (older ones render as static text) */
|
|
22
|
+
animateLastN?: number;
|
|
23
|
+
/** Whether cursor is present in content */
|
|
24
|
+
hasCursor?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const WordAnimationProvider: React.FC<WordAnimationProviderProps>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { createContext, useRef, useMemo, useContext } from 'react';
|
|
3
|
+
import { motion } from 'motion/react';
|
|
4
|
+
import { inlineTokenTransition, inlineTokenFadeIn } from './StreamingResponse.animations.js';
|
|
5
|
+
|
|
6
|
+
const WordAnimationContext = createContext(null);
|
|
7
|
+
const useWordAnimation = () => useContext(WordAnimationContext);
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Helpers
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
/** Split a string into word tokens, preserving trailing whitespace on each */
|
|
12
|
+
const tokenize = (text) => {
|
|
13
|
+
if (!text)
|
|
14
|
+
return [];
|
|
15
|
+
return text.match(/\S+\s*/g) || [];
|
|
16
|
+
};
|
|
17
|
+
/** Count prose words in a React children tree (recursive) */
|
|
18
|
+
const countWordsInChildren = (children) => {
|
|
19
|
+
let count = 0;
|
|
20
|
+
React__default.Children.forEach(children, (child) => {
|
|
21
|
+
if (typeof child === 'string') {
|
|
22
|
+
count += tokenize(child).length;
|
|
23
|
+
}
|
|
24
|
+
else if (React__default.isValidElement(child)) {
|
|
25
|
+
const props = child.props;
|
|
26
|
+
if (props.children) {
|
|
27
|
+
count += countWordsInChildren(props.children);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return count;
|
|
32
|
+
};
|
|
33
|
+
const WordAnimationProvider = ({ children, content, enabled, animateLastN = 6, hasCursor = false, }) => {
|
|
34
|
+
const settledCountRef = useRef(0);
|
|
35
|
+
// Count total prose words in the raw content
|
|
36
|
+
const totalWords = useMemo(() => {
|
|
37
|
+
// Strip the cursor character before counting
|
|
38
|
+
const cleanContent = hasCursor ? content.replace(/\s*▍\s*$/, '') : content;
|
|
39
|
+
return tokenize(cleanContent).length;
|
|
40
|
+
}, [content, hasCursor]);
|
|
41
|
+
// Update settled count — words that have aged out of the animation window
|
|
42
|
+
if (totalWords > settledCountRef.current + animateLastN) {
|
|
43
|
+
settledCountRef.current = totalWords - animateLastN;
|
|
44
|
+
}
|
|
45
|
+
// Mutable counter — reset each render, incremented as text nodes are processed
|
|
46
|
+
const wordIndexRef = useRef(0);
|
|
47
|
+
wordIndexRef.current = 0;
|
|
48
|
+
const settledCount = settledCountRef.current;
|
|
49
|
+
const contextValue = useMemo(() => {
|
|
50
|
+
if (!enabled) {
|
|
51
|
+
return {
|
|
52
|
+
processChildren: (children) => children,
|
|
53
|
+
skipChildren: () => { },
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Process React children, wrapping recent words in motion.span
|
|
58
|
+
* Preserves element structure (strong, em, a, etc.) by recursing into them
|
|
59
|
+
*/
|
|
60
|
+
const processChildren = (children) => {
|
|
61
|
+
return React__default.Children.map(children, (child) => {
|
|
62
|
+
if (typeof child === 'string') {
|
|
63
|
+
return processTextNode(child);
|
|
64
|
+
}
|
|
65
|
+
if (React__default.isValidElement(child)) {
|
|
66
|
+
const props = child.props;
|
|
67
|
+
if (props.children) {
|
|
68
|
+
// Recurse into inline elements (strong, em, a, del, code, etc.)
|
|
69
|
+
const processed = processChildren(props.children);
|
|
70
|
+
return React__default.cloneElement(child, {}, processed);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return child;
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Process a text string node — split into words, settled words become plain,
|
|
78
|
+
* recent words become motion.span with fade-in
|
|
79
|
+
*/
|
|
80
|
+
const processTextNode = (text) => {
|
|
81
|
+
const tokens = tokenize(text);
|
|
82
|
+
if (tokens.length === 0)
|
|
83
|
+
return text;
|
|
84
|
+
const result = [];
|
|
85
|
+
let staticBuffer = '';
|
|
86
|
+
for (const token of tokens) {
|
|
87
|
+
const currentIndex = wordIndexRef.current;
|
|
88
|
+
wordIndexRef.current++;
|
|
89
|
+
// Check if this is the cursor character
|
|
90
|
+
if (token.trim() === '▍') {
|
|
91
|
+
// Flush static buffer
|
|
92
|
+
if (staticBuffer) {
|
|
93
|
+
result.push(staticBuffer);
|
|
94
|
+
staticBuffer = '';
|
|
95
|
+
}
|
|
96
|
+
result.push(jsx("span", { className: "animate-pulse font-light", "aria-hidden": "true", children: "\u258D" }, "streaming-cursor"));
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (currentIndex < settledCount) {
|
|
100
|
+
// Settled word — accumulate into static string
|
|
101
|
+
staticBuffer += token;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// Flush static buffer before animated tokens
|
|
105
|
+
if (staticBuffer) {
|
|
106
|
+
result.push(staticBuffer);
|
|
107
|
+
staticBuffer = '';
|
|
108
|
+
}
|
|
109
|
+
// Animated word
|
|
110
|
+
result.push(jsx(motion.span, { variants: inlineTokenFadeIn, initial: "hidden", animate: "visible", transition: inlineTokenTransition, style: { display: 'inline' }, children: token }, `word-${currentIndex}-${token.trim()}`));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Flush any remaining static buffer
|
|
114
|
+
if (staticBuffer) {
|
|
115
|
+
result.push(staticBuffer);
|
|
116
|
+
}
|
|
117
|
+
return result.length === 1 ? result[0] : jsx(Fragment, { children: result });
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Count words in children without producing animated output.
|
|
121
|
+
* Used for non-prose elements (code blocks, tables) to keep counter in sync.
|
|
122
|
+
*/
|
|
123
|
+
const skipChildren = (children) => {
|
|
124
|
+
const count = countWordsInChildren(children);
|
|
125
|
+
wordIndexRef.current += count;
|
|
126
|
+
};
|
|
127
|
+
return { processChildren, skipChildren };
|
|
128
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
129
|
+
}, [enabled, settledCount, totalWords]);
|
|
130
|
+
return (jsx(WordAnimationContext.Provider, { value: contextValue, children: children }));
|
|
131
|
+
};
|
|
132
|
+
WordAnimationProvider.displayName = 'WordAnimationProvider';
|
|
133
|
+
|
|
134
|
+
export { WordAnimationProvider, useWordAnimation };
|
|
@@ -7,9 +7,11 @@ export { ErrorDisplay } from './ErrorDisplay';
|
|
|
7
7
|
export { MarkdownRenderer } from './MarkdownRenderer';
|
|
8
8
|
export { AnimatedText } from './AnimatedText';
|
|
9
9
|
export { StreamingCursor } from './StreamingCursor';
|
|
10
|
+
export { WordAnimationProvider, useWordAnimation } from './WordAnimationContext';
|
|
10
11
|
export { streamingResponseTheme } from './StreamingResponse.theme';
|
|
11
|
-
export { tokenFadeIn, tokenTransition, blockSlideIn, blockTransition, cursorPulse, staggerContainer, } from './StreamingResponse.animations';
|
|
12
|
+
export { tokenFadeIn, tokenTransition, blockSlideIn, blockTransition, inlineTokenFadeIn, inlineTokenTransition, cursorPulse, staggerContainer, } from './StreamingResponse.animations';
|
|
12
13
|
export type { StreamingResponseProps, StreamingResponseTheme, MarkdownOptions, MessageAvatarProps, } from './StreamingResponse.types';
|
|
13
14
|
export type { AnimatedTextProps } from './AnimatedText';
|
|
14
15
|
export type { StreamingCursorProps } from './StreamingCursor';
|
|
15
16
|
export type { MarkdownRendererProps } from './MarkdownRenderer';
|
|
17
|
+
export type { WordAnimationProviderProps } from './WordAnimationContext';
|
|
@@ -8,19 +8,19 @@ const tokenCounterTheme = {
|
|
|
8
8
|
progressBarStyle: "h-full bg-[var(--color-primary)] transition-all duration-200",
|
|
9
9
|
sizes: {
|
|
10
10
|
sm: {
|
|
11
|
-
container: "text-
|
|
11
|
+
container: "text-sm",
|
|
12
12
|
icon: "size-3",
|
|
13
|
-
text: "text-
|
|
13
|
+
text: "text-sm",
|
|
14
14
|
},
|
|
15
15
|
md: {
|
|
16
|
-
container: "text-
|
|
16
|
+
container: "text-base",
|
|
17
17
|
icon: "size-4",
|
|
18
|
-
text: "text-
|
|
18
|
+
text: "text-base",
|
|
19
19
|
},
|
|
20
20
|
lg: {
|
|
21
|
-
container: "text-
|
|
21
|
+
container: "text-lg",
|
|
22
22
|
icon: "size-5",
|
|
23
|
-
text: "text-
|
|
23
|
+
text: "text-lg",
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -17,6 +17,7 @@ export { ErrorDisplay } from './StreamingResponse/ErrorDisplay.js';
|
|
|
17
17
|
export { MarkdownRenderer } from './StreamingResponse/MarkdownRenderer.js';
|
|
18
18
|
export { AnimatedText } from './StreamingResponse/AnimatedText.js';
|
|
19
19
|
export { StreamingCursor } from './StreamingResponse/StreamingCursor.js';
|
|
20
|
+
import './StreamingResponse/WordAnimationContext.js';
|
|
20
21
|
export { streamingResponseTheme } from './StreamingResponse/StreamingResponse.theme.js';
|
|
21
22
|
export { blockSlideIn, blockTransition, cursorPulse, staggerContainer, tokenFadeIn, tokenTransition } from './StreamingResponse/StreamingResponse.animations.js';
|
|
22
23
|
export { CodeBlock } from './CodeBlock/CodeBlock.js';
|
|
@@ -83,7 +83,7 @@ const ActivityRings = ({ rings, centerLabel, centerSuffix, size = ACTIVITY_RINGS
|
|
|
83
83
|
}
|
|
84
84
|
// Early return for invalid configuration
|
|
85
85
|
if (!Array.isArray(rings) || rings.length === 0) {
|
|
86
|
-
return (jsxs("div", { className: cn("flex items-center justify-center p-6 border border-[var(--color-border)] rounded-lg", className), role: "alert", ...props, children: [jsx(ExclamationTriangleIcon, { className: "size-5 text-[var(--color-danger)] mr-2" }), jsx("span", { className: "text-
|
|
86
|
+
return (jsxs("div", { className: cn("flex items-center justify-center p-6 border border-[var(--color-border)] rounded-lg", className), role: "alert", ...props, children: [jsx(ExclamationTriangleIcon, { className: "size-5 text-[var(--color-danger)] mr-2" }), jsx("span", { className: "text-base text-[var(--color-text-secondary)]", children: "Invalid ActivityRings: rings array is required" })] }));
|
|
87
87
|
}
|
|
88
88
|
// State for controlling initial animation
|
|
89
89
|
const [hasAnimated, setHasAnimated] = useState(false);
|
|
@@ -18,8 +18,8 @@ const activityRingsTheme = {
|
|
|
18
18
|
],
|
|
19
19
|
},
|
|
20
20
|
centerText: {
|
|
21
|
-
label: "text-
|
|
22
|
-
suffix: "text-
|
|
21
|
+
label: "text-2xl font-semibold text-[var(--color-text-primary)]",
|
|
22
|
+
suffix: "text-base font-normal text-[var(--color-text-secondary)]/80",
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -89,9 +89,9 @@ className, title, description, enableKeyboardNavigation = BAR_CHART_DEFAULTS.ena
|
|
|
89
89
|
});
|
|
90
90
|
// Early return for invalid data with error message
|
|
91
91
|
if (!isValid) {
|
|
92
|
-
return (jsxs("div", { className: cn("chart-container flex flex-col items-center justify-center p-6 border border-border rounded-lg text-
|
|
92
|
+
return (jsxs("div", { className: cn("chart-container flex flex-col items-center justify-center p-6 border border-border rounded-lg text-2xl", className), role: "alert", "aria-live": "polite", ...props, children: [jsxs("div", { className: "flex flex-col items-center gap-4 mb-1", children: [jsx(ExclamationTriangleIcon, { className: "size-6 text-[var(--color-danger)]" }), jsx("div", { className: "text-base font-semibold text-[var(--color-text-secondary)]", children: "Invalid Chart Data" })] }), jsx("p", { className: "text-base text-[var(--color-text-secondary)]/70 mb-2", children: ((_b = validation.errors[0]) === null || _b === void 0 ? void 0 : _b.message) ||
|
|
93
93
|
"Unable to render chart due to data validation errors" }), process.env.NODE_ENV === "development" &&
|
|
94
|
-
validation.errors.length > 1 && (jsxs("details", { className: "text-
|
|
94
|
+
validation.errors.length > 1 && (jsxs("details", { className: "text-sm text-warning-500", children: [jsxs("summary", { className: "cursor-pointer", children: ["Show all errors (", validation.errors.length, ")"] }), jsx("ul", { className: "mt-2 text-left", children: validation.errors.map((error, index) => (jsxs("li", { children: ["\u2022 ", error.message] }, index))) })] }))] }));
|
|
95
95
|
}
|
|
96
96
|
// Early return for empty data
|
|
97
97
|
if (!sanitizedData || sanitizedData.length === 0) {
|
|
@@ -415,7 +415,7 @@ className, title, description, enableKeyboardNavigation = BAR_CHART_DEFAULTS.ena
|
|
|
415
415
|
}
|
|
416
416
|
: undefined }, keyIndex));
|
|
417
417
|
};
|
|
418
|
-
return (jsx(ChartErrorBoundary, { className: className, showErrorDetails: process.env.NODE_ENV === "development", children: jsxs("div", { ref: containerRef, className: cn("chart-container w-full h-full", darkMode && "dark", className), ...chartAccessibilityProps, onMouseEnter: handleMouseInteraction, onMouseMove: handleMouseInteraction, ...props, children: [descriptionProps && jsx("div", { ...descriptionProps }), showValidationWarnings && hasWarnings && (jsxs("div", { className: "absolute top-2 left-2 right-2 z-10 p-2 bg-[var(--color-warning-50)] border border-[var(--color-warning-200)] rounded text-
|
|
418
|
+
return (jsx(ChartErrorBoundary, { className: className, showErrorDetails: process.env.NODE_ENV === "development", children: jsxs("div", { ref: containerRef, className: cn("chart-container w-full h-full", darkMode && "dark", className), ...chartAccessibilityProps, onMouseEnter: handleMouseInteraction, onMouseMove: handleMouseInteraction, ...props, children: [descriptionProps && jsx("div", { ...descriptionProps }), showValidationWarnings && hasWarnings && (jsxs("div", { className: "absolute top-2 left-2 right-2 z-10 p-2 bg-[var(--color-warning-50)] border border-[var(--color-warning-200)] rounded text-sm text-[var(--color-warning)] shadow-sm", children: [jsx("strong", { children: "Chart Warnings:" }), jsx("ul", { className: "mt-1", children: validation.warnings
|
|
419
419
|
.filter((warning) => !warning.message.includes("has no valid numeric values"))
|
|
420
420
|
.map((warning, index) => (jsxs("li", { children: ["\u2022 ", warning.message] }, index))) }), validation.warnings.some((warning) => warning.message.includes("has no valid numeric values")) && (jsx("div", { className: "mt-2 pt-2 border-t border-[var(--color-warning-200)]", children: jsx("span", { className: "text-[var(--color-warning)]", children: "\u2139\uFE0F Null/undefined values are handled by using averages from other data points" }) }))] })), jsxs("svg", { width: "100%", height: "100%", viewBox: `0 0 ${dimensions.width} ${dimensions.height}`, children: [jsx("defs", { children: jsxs("pattern", { id: "diagonalHatch", patternUnits: "userSpaceOnUse", width: "8", height: "8", children: [jsx("rect", { width: "8", height: "8", fill: "var(--color-neutral-50)" }), jsx("path", { d: "M-2,2 l4,-4\n M0,8 l8,-8\n M6,10 l4,-4", style: { stroke: "black", strokeWidth: 4, opacity: 0.1 } })] }) }), jsx(HorizontalGrid, { show: showGrid, x: margin.left, y: margin.top, width: innerWidth, height: innerHeight, lineCount: 5 }), jsx(YAxis, { show: showYAxis, min: minValue, max: maxValue, x: margin.left, y: margin.top, height: innerHeight, showGrid: false, gridWidth: innerWidth, tickFormatter: (value) => {
|
|
421
421
|
if (Math.abs(value) >= 1000)
|
|
@@ -34,7 +34,7 @@ function ChartContainer({ data, config, className, children, minHeight = 200, wi
|
|
|
34
34
|
minHeight: typeof minHeight === 'number' ? `${minHeight}px` : minHeight
|
|
35
35
|
}),
|
|
36
36
|
};
|
|
37
|
-
return (jsx(ChartContext.Provider, { value: { data: data || [], config: safeConfig }, children: jsx("div", { className: cn("flex aspect-auto justify-center text-
|
|
37
|
+
return (jsx(ChartContext.Provider, { value: { data: data || [], config: safeConfig }, children: jsx("div", { className: cn("flex aspect-auto justify-center text-sm",
|
|
38
38
|
// Add w-full as default if no width class is specified
|
|
39
39
|
!hasWidthClass && "w-full", className), style: inlineStyles, ...props, children: children }) }));
|
|
40
40
|
}
|
|
@@ -129,7 +129,7 @@ className, title, description, enableKeyboardNavigation = COMBO_CHART_DEFAULTS.e
|
|
|
129
129
|
});
|
|
130
130
|
// Early return for invalid data with error message
|
|
131
131
|
if (!isValid) {
|
|
132
|
-
return (jsxs("div", { className: cn("chart-container flex flex-col items-center justify-center p-6 border border-border rounded-lg text-
|
|
132
|
+
return (jsxs("div", { className: cn("chart-container flex flex-col items-center justify-center p-6 border border-border rounded-lg text-2xl", className), role: "alert", "aria-live": "polite", ...props, children: [jsxs("div", { className: "flex flex-col items-center gap-4 mb-1", children: [jsx(ExclamationTriangleIcon, { className: "size-6 text-[var(--color-danger)]" }), jsx("div", { className: "text-base font-semibold text-[var(--color-text-secondary)]", children: "Invalid Chart Data" })] }), jsx("p", { className: "text-base text-[var(--color-text-secondary)]/70 mb-2", children: "Unable to render chart due to data validation errors" })] }));
|
|
133
133
|
}
|
|
134
134
|
// Early return for empty data
|
|
135
135
|
if (!sanitizedData || sanitizedData.length === 0) {
|
|
@@ -141,7 +141,7 @@ className, title, description, enableKeyboardNavigation = COMBO_CHART_DEFAULTS.e
|
|
|
141
141
|
lineSeries.forEach((key) => {
|
|
142
142
|
config[key];
|
|
143
143
|
});
|
|
144
|
-
return (jsxs(ChartContainer, { data: sanitizedData, config: config, scales: scales, showGrid: showGrid, showXAxis: showXAxis, showYAxis: showYAxis, categoryGap: categoryGap, className: className, title: title, description: description, enableKeyboardNavigation: enableKeyboardNavigation, chartType: "combo", ...props, children: [jsx(ComboChartRenderers, { barKeys: barSeries, lineKeys: lineSeries, stacked: stacked, barRadius: resolvedBarRadius, dotRadius: resolvedDotRadius, gap: gap, categoryGap: categoryGap, strokeWidth: strokeWidth, curved: curved, curveType: curveType, showDots: showDots }), showValidationWarnings && hasWarnings && (jsx("foreignObject", { x: "0", y: "0", width: "100%", height: "50", children: jsxs("div", { className: "p-2 bg-[var(--color-warning-50)] border border-[var(--color-warning-200)] rounded text-
|
|
144
|
+
return (jsxs(ChartContainer, { data: sanitizedData, config: config, scales: scales, showGrid: showGrid, showXAxis: showXAxis, showYAxis: showYAxis, categoryGap: categoryGap, className: className, title: title, description: description, enableKeyboardNavigation: enableKeyboardNavigation, chartType: "combo", ...props, children: [jsx(ComboChartRenderers, { barKeys: barSeries, lineKeys: lineSeries, stacked: stacked, barRadius: resolvedBarRadius, dotRadius: resolvedDotRadius, gap: gap, categoryGap: categoryGap, strokeWidth: strokeWidth, curved: curved, curveType: curveType, showDots: showDots }), showValidationWarnings && hasWarnings && (jsx("foreignObject", { x: "0", y: "0", width: "100%", height: "50", children: jsxs("div", { className: "p-2 bg-[var(--color-warning-50)] border border-[var(--color-warning-200)] rounded text-sm text-[var(--color-warning)] shadow-sm", children: [jsx("strong", { children: "Chart Warnings:" }), " Some data validation warnings occurred."] }) })), children] }));
|
|
145
145
|
};
|
|
146
146
|
|
|
147
147
|
export { ComboChart };
|
|
@@ -11,7 +11,7 @@ const donutChartTheme = {
|
|
|
11
11
|
// Text styling
|
|
12
12
|
text: {
|
|
13
13
|
label: "text-2xl font-bold text-[var(--color-text-primary)] transition-colors duration-300 tracking-tight",
|
|
14
|
-
subtitle: "text-
|
|
14
|
+
subtitle: "text-base text-[var(--color-text-secondary)] mt-1 transition-colors duration-300",
|
|
15
15
|
},
|
|
16
16
|
// Default color palette (CSS variables for dark mode support)
|
|
17
17
|
// Note: These are resolved at runtime via getComputedStyle
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HTMLMotionProps } from "motion/react";
|
|
3
2
|
/**
|
|
4
3
|
* Color configuration for the donut chart
|
|
5
4
|
*/
|
|
@@ -41,7 +40,7 @@ export interface DonutChartThemeOverrides {
|
|
|
41
40
|
/**
|
|
42
41
|
* DonutChart component props
|
|
43
42
|
*/
|
|
44
|
-
export interface DonutChartProps extends Omit<
|
|
43
|
+
export interface DonutChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
45
44
|
/**
|
|
46
45
|
* Visual variant for the donut chart (solid or segmented)
|
|
47
46
|
* @default "solid"
|
|
@@ -243,7 +243,7 @@ const MultiSegmentDonutChart = ({ data, size = 200, thickness = 4, segmentGap =
|
|
|
243
243
|
}) }));
|
|
244
244
|
};
|
|
245
245
|
if (!data || data.length === 0) {
|
|
246
|
-
return (jsx("div", { className: cn(theme.baseStyle, className), style: { width: containerSize, height: containerSize }, children: jsx("div", { className: "text-
|
|
246
|
+
return (jsx("div", { className: cn(theme.baseStyle, className), style: { width: containerSize, height: containerSize }, children: jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: "No data" }) }));
|
|
247
247
|
}
|
|
248
248
|
return (jsxs("div", { className: cn("flex gap-4 items-center", getLayoutClasses(), className), children: [jsxs(motion.div, { className: cn(theme.baseStyle), style: { width: containerSize, height: containerSize }, role: "img", "aria-label": `Donut chart with ${segments.length} segments`, ...restProps, children: [jsxs("svg", { viewBox: `0 0 ${svgSize} ${svgSize}`, width: "100%", height: "100%", className: "overflow-visible relative z-10", children: [jsx("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: "#000000", strokeWidth: strokeWidth > 2 ? strokeWidth - 2 : 1, opacity: 0.03 }), segments.map((segment, index) => roundedCaps ? (jsx(AnimatedStrokeSegment, { center: center, radius: radius, strokeWidth: strokeWidth, startAngle: segment.startAngle, endAngle: segment.endAngle, color: segment.color, delay: segment.animationDelay, shouldAnimate: showAnimation && hasAnimated, shouldReduceMotion: shouldReduceMotion, isHovered: hoveredSegment === index, isFaded: hoveredSegment !== null && hoveredSegment !== index, onMouseEnter: () => handleSegmentMouseEnter(index), onMouseLeave: handleSegmentMouseLeave, onClick: () => handleSegmentClick(index), clickable: !!onSegmentClick }, `segment-${index}`)) : (jsx(AnimatedSegment, { center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: segment.startAngle, endAngle: segment.endAngle, color: segment.color, delay: segment.animationDelay, duration: segment.animationDuration, shouldAnimate: showAnimation && hasAnimated, shouldReduceMotion: shouldReduceMotion, isHovered: hoveredSegment === index, isFaded: hoveredSegment !== null && hoveredSegment !== index, onMouseEnter: () => handleSegmentMouseEnter(index), onMouseLeave: handleSegmentMouseLeave, onClick: () => handleSegmentClick(index), clickable: !!onSegmentClick }, `segment-${index}`)))] }), centerContent && (jsx("div", { className: cn(theme.centerContent), children: centerContent }))] }), renderLegend()] }));
|
|
249
249
|
};
|
|
@@ -8,7 +8,7 @@ const multiSegmentDonutChartTheme = {
|
|
|
8
8
|
track: "text-[var(--color-border)]",
|
|
9
9
|
// Legend styling
|
|
10
10
|
legend: {
|
|
11
|
-
container: "flex flex-col gap-2 text-
|
|
11
|
+
container: "flex flex-col gap-2 text-base",
|
|
12
12
|
item: "flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity",
|
|
13
13
|
label: "text-[var(--color-text-primary)] font-medium",
|
|
14
14
|
value: "text-[var(--color-text-secondary)] ml-auto",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { HTMLMotionProps } from "motion/react";
|
|
3
2
|
/**
|
|
4
3
|
* Data segment for the multi-segment donut chart
|
|
5
4
|
*/
|
|
@@ -52,7 +51,7 @@ export interface MultiSegmentDonutChartThemeOverrides {
|
|
|
52
51
|
/**
|
|
53
52
|
* MultiSegmentDonutChart component props
|
|
54
53
|
*/
|
|
55
|
-
export interface MultiSegmentDonutChartProps extends Omit<
|
|
54
|
+
export interface MultiSegmentDonutChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
56
55
|
/**
|
|
57
56
|
* Array of data segments to display
|
|
58
57
|
* Each segment should have value and percentage
|
|
@@ -72,7 +72,7 @@ const FunnelChart = ({ data, height = 400, width = 600, showPercentages = true,
|
|
|
72
72
|
const containerWidth = typeof width === "number" ? `${width}px` : width;
|
|
73
73
|
// Return empty state if no valid data
|
|
74
74
|
if (stages.length === 0) {
|
|
75
|
-
return (jsx("div", { className: cn(theme.baseStyle, className), style: { width: containerWidth, height: containerHeight }, role: "img", "aria-label": "Empty funnel chart - no data available", ...props, children: jsx("div", { className: "flex items-center justify-center h-full text-[var(--color-text-muted)] text-
|
|
75
|
+
return (jsx("div", { className: cn(theme.baseStyle, className), style: { width: containerWidth, height: containerHeight }, role: "img", "aria-label": "Empty funnel chart - no data available", ...props, children: jsx("div", { className: "flex items-center justify-center h-full text-[var(--color-text-muted)] text-base", children: "No data available" }) }));
|
|
76
76
|
}
|
|
77
77
|
const viewBoxWidth = 150;
|
|
78
78
|
const viewBoxHeight = 100;
|
|
@@ -356,9 +356,9 @@ const FunnelChart = ({ data, height = 400, width = 600, showPercentages = true,
|
|
|
356
356
|
animate: "visible",
|
|
357
357
|
custom: index,
|
|
358
358
|
}
|
|
359
|
-
: {}), children: [jsx("div", { className: cn("text-
|
|
359
|
+
: {}), children: [jsx("div", { className: cn("text-base font-semibold whitespace-nowrap", labelPosition === "inside"
|
|
360
360
|
? "text-white drop-shadow-md"
|
|
361
|
-
: "text-[var(--color-text-primary)]"), children: stage.name }), (showValues || showPercentages) && (jsxs("div", { className: cn("text-
|
|
361
|
+
: "text-[var(--color-text-primary)]"), children: stage.name }), (showValues || showPercentages) && (jsxs("div", { className: cn("text-sm whitespace-nowrap", labelPosition === "inside"
|
|
362
362
|
? "text-white/90 drop-shadow-md"
|
|
363
363
|
: "text-[var(--color-text-secondary)]"), children: [showValues && formatDisplayValue(stage.value), showValues && showPercentages && " • ", showPercentages && `${stage.percentage.toFixed(0)}%`] }))] }, `label-${stage.name}`));
|
|
364
364
|
}), orientation === "vertical" &&
|
|
@@ -376,7 +376,7 @@ const FunnelChart = ({ data, height = 400, width = 600, showPercentages = true,
|
|
|
376
376
|
animate: "visible",
|
|
377
377
|
custom: index,
|
|
378
378
|
}
|
|
379
|
-
: {}), children: [jsx("div", { className: "text-
|
|
379
|
+
: {}), children: [jsx("div", { className: "text-base font-semibold text-white drop-shadow-md whitespace-nowrap text-center", children: stage.name }), (showValues || showPercentages) && (jsxs("div", { className: "text-sm text-white/90 drop-shadow-md whitespace-nowrap text-center", children: [showValues && formatDisplayValue(stage.value), showValues && showPercentages && " • ", showPercentages && `${stage.percentage.toFixed(0)}%`] }))] }, `label-${stage.name}`));
|
|
380
380
|
}), orientation === "horizontal" &&
|
|
381
381
|
showDropoff &&
|
|
382
382
|
stages.map((stage, index) => {
|
|
@@ -394,7 +394,7 @@ const FunnelChart = ({ data, height = 400, width = 600, showPercentages = true,
|
|
|
394
394
|
animate: "visible",
|
|
395
395
|
custom: index,
|
|
396
396
|
}
|
|
397
|
-
: {}), children: jsxs("span", { className: "text-
|
|
397
|
+
: {}), children: jsxs("span", { className: "text-sm text-[var(--color-danger)] font-medium", children: ["-", stage.dropoff.toFixed(1), "%"] }) }, `dropoff-${stage.name}`));
|
|
398
398
|
}), orientation === "vertical" &&
|
|
399
399
|
showDropoff &&
|
|
400
400
|
stages.map((stage, index) => {
|
|
@@ -411,7 +411,7 @@ const FunnelChart = ({ data, height = 400, width = 600, showPercentages = true,
|
|
|
411
411
|
animate: "visible",
|
|
412
412
|
custom: index,
|
|
413
413
|
}
|
|
414
|
-
: {}), children: jsxs("span", { className: "text-
|
|
414
|
+
: {}), children: jsxs("span", { className: "text-sm text-[var(--color-danger)] font-medium", children: ["-", stage.dropoff.toFixed(1), "%"] }) }, `dropoff-${stage.name}`));
|
|
415
415
|
}), orientation === "horizontal" &&
|
|
416
416
|
showConversionRate &&
|
|
417
417
|
stages.map((stage, index) => {
|
|
@@ -455,7 +455,7 @@ const FunnelChart = ({ data, height = 400, width = 600, showPercentages = true,
|
|
|
455
455
|
initial: "hidden",
|
|
456
456
|
animate: "visible",
|
|
457
457
|
}
|
|
458
|
-
: {}), children: [jsx("div", { className: "text-
|
|
458
|
+
: {}), children: [jsx("div", { className: "text-sm text-[var(--color-text-secondary)] mb-1", children: "Overall Conversion" }), jsxs("div", { className: "text-xl font-bold text-[var(--color-text-primary)]", children: [overallConversion, "%"] }), jsxs("div", { className: "text-sm text-[var(--color-text-muted)] mt-1", children: [formatDisplayValue(stages[0].value), " \u2192", " ", formatDisplayValue(stages[stages.length - 1].value)] })] })), jsx(ChartTooltip, { active: !!tooltipData, position: tooltipData ? { x: tooltipData.x, y: tooltipData.y } : { x: 0, y: 0 }, tooltipRef: tooltipRef, content: tooltipData === null || tooltipData === void 0 ? void 0 : tooltipData.content, chartType: "area" })] }));
|
|
459
459
|
};
|
|
460
460
|
FunnelChart.displayName = "FunnelChart";
|
|
461
461
|
|
|
@@ -10,7 +10,7 @@ const heatmapTheme = {
|
|
|
10
10
|
// Base cell styles (individual cells add opacity via inline styles)
|
|
11
11
|
cellBaseStyle: "relative w-full h-full cursor-pointer border border-transparent transition-all duration-500 animate-[flicker_0.6s_ease-out_forwards]",
|
|
12
12
|
// Axis labels using CSS variables for dark mode support
|
|
13
|
-
axisLabelStyle: "text-
|
|
13
|
+
axisLabelStyle: "text-sm text-[var(--color-text-secondary)] font-medium select-none",
|
|
14
14
|
// Legend using correct CSS variables
|
|
15
15
|
legendStyle: "w-full space-y-1.5 mt-3",
|
|
16
16
|
};
|
|
@@ -88,7 +88,7 @@ className, onClick, onHover, onMouseMove, onLeave, children, }) => {
|
|
|
88
88
|
e.preventDefault();
|
|
89
89
|
onClick(data);
|
|
90
90
|
}
|
|
91
|
-
}, children: children && (jsx("div", { className: "absolute inset-0 flex items-center justify-center text-
|
|
91
|
+
}, children: children && (jsx("div", { className: "absolute inset-0 flex items-center justify-center text-sm font-medium text-gray-700 dark:text-gray-300", children: children })) }));
|
|
92
92
|
};
|
|
93
93
|
const HeatmapCell = React__default.memo(HeatmapCellInner);
|
|
94
94
|
|
|
@@ -11,7 +11,7 @@ minValue = 0, maxValue = 100, labels = {
|
|
|
11
11
|
const gradientStyle = {
|
|
12
12
|
background: `linear-gradient(to right, color-mix(in srgb, ${color} 20%, transparent), ${color})`
|
|
13
13
|
};
|
|
14
|
-
return (jsxs("div", { className: cn(heatmapTheme.legendStyle, className), children: [jsx("div", { className: "w-full h-1.5 rounded-full", style: gradientStyle }), jsxs("div", { className: "flex items-center justify-between text-
|
|
14
|
+
return (jsxs("div", { className: cn(heatmapTheme.legendStyle, className), children: [jsx("div", { className: "w-full h-1.5 rounded-full", style: gradientStyle }), jsxs("div", { className: "flex items-center justify-between text-sm font-medium text-[var(--color-text-secondary)]", children: [jsx("div", { children: labels.min }), jsx("div", { children: labels.max })] })] }));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export { HeatmapLegend };
|
|
@@ -13,11 +13,11 @@ const radarChartTheme = {
|
|
|
13
13
|
// Axis spoke stroke color (gray-300 equivalent)
|
|
14
14
|
axisColor: "#d1d5db",
|
|
15
15
|
// Axis label classes (applied to <text> elements via className)
|
|
16
|
-
labelStyle: "text-
|
|
16
|
+
labelStyle: "text-sm fill-[#6b7280] select-none",
|
|
17
17
|
// Legend container
|
|
18
18
|
legendStyle: "flex flex-wrap items-center justify-center gap-x-6 gap-y-2",
|
|
19
19
|
// Individual legend item
|
|
20
|
-
legendItemStyle: "flex items-center gap-2 text-
|
|
20
|
+
legendItemStyle: "flex items-center gap-2 text-base",
|
|
21
21
|
// Colored dot in legend
|
|
22
22
|
legendDotStyle: "w-2.5 h-2.5 rounded-full shrink-0",
|
|
23
23
|
// Legend label text
|
|
@@ -201,7 +201,7 @@ showGrid = SCATTER_PLOT_DEFAULTS.showGrid, showXAxis = SCATTER_PLOT_DEFAULTS.sho
|
|
|
201
201
|
}
|
|
202
202
|
handleMouseInteraction();
|
|
203
203
|
}, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave }, index));
|
|
204
|
-
}), jsx(XAxis, { show: showXAxis, data: xAxisData, x: margin.left, y: margin.top + innerHeight, width: innerWidth, categoryWidth: innerWidth / (xAxisData.length - 1), categoryGap: 0, alignWithEdge: true, className: cn(axisClassName) }), xLabel && showXAxis && (jsx("text", { x: margin.left + innerWidth / 2, y: dimensions.height - 5, textAnchor: "middle", className: "text-
|
|
204
|
+
}), jsx(XAxis, { show: showXAxis, data: xAxisData, x: margin.left, y: margin.top + innerHeight, width: innerWidth, categoryWidth: innerWidth / (xAxisData.length - 1), categoryGap: 0, alignWithEdge: true, className: cn(axisClassName) }), xLabel && showXAxis && (jsx("text", { x: margin.left + innerWidth / 2, y: dimensions.height - 5, textAnchor: "middle", className: "text-sm fill-[var(--color-text-secondary)]", children: xLabel })), yLabel && showYAxis && (jsx("text", { x: 15, y: margin.top + innerHeight / 2, textAnchor: "middle", className: "text-sm fill-[var(--color-text-secondary)]", transform: `rotate(-90 15 ${margin.top + innerHeight / 2})`, children: yLabel }))] }), categories.length > 0 && (jsx("div", { className: theme.legendContainerStyle, children: categories.map((cat, index) => (jsxs("div", { className: theme.legendItemStyle, children: [jsx("div", { className: theme.legendDotStyle, style: { backgroundColor: getCategoryColor(chartColors, index) } }), jsx("span", { className: theme.legendLabelStyle, children: cat })] }, cat))) })), showTooltip && (jsx(ChartTooltip, { active: !!tooltipData, position: tooltipData ? { x: tooltipData.x, y: tooltipData.y } : { x: 0, y: 0 }, tooltipRef: tooltipRef, content: tooltipData === null || tooltipData === void 0 ? void 0 : tooltipData.content, chartType: "scatter" }))] }));
|
|
205
205
|
};
|
|
206
206
|
ScatterPlot.displayName = 'ScatterPlot';
|
|
207
207
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
const scatterPlotTheme = {
|
|
5
5
|
containerStyle: 'relative inline-flex flex-col items-center w-full',
|
|
6
6
|
svgStyle: 'overflow-visible',
|
|
7
|
-
emptyStateStyle: 'flex items-center justify-center h-full text-[var(--color-text-muted)] text-
|
|
7
|
+
emptyStateStyle: 'flex items-center justify-center h-full text-[var(--color-text-muted)] text-base',
|
|
8
8
|
// Grid styles
|
|
9
9
|
gridLineStyle: 'stroke-[var(--color-border)]',
|
|
10
10
|
// Axis styles
|
|
@@ -17,7 +17,7 @@ const scatterPlotTheme = {
|
|
|
17
17
|
legendContainerStyle: 'flex flex-wrap gap-3 mt-4 justify-center',
|
|
18
18
|
legendItemStyle: 'flex items-center gap-2',
|
|
19
19
|
legendDotStyle: 'w-3 h-3 rounded-full',
|
|
20
|
-
legendLabelStyle: 'text-
|
|
20
|
+
legendLabelStyle: 'text-base text-[var(--color-text-secondary)]',
|
|
21
21
|
// Default category colors using CSS variables
|
|
22
22
|
colors: [
|
|
23
23
|
'var(--color-primary)',
|