@flikk/ui 1.0.0-beta.30 → 1.0.0-beta.32
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/CHANGELOG.md +375 -5
- package/dist/components/ai/AgentRequest/AgentRequest.animations.d.ts +25 -0
- package/dist/components/ai/AgentRequest/AgentRequest.animations.js +81 -0
- package/dist/components/ai/AgentRequest/AgentRequest.d.ts +3 -0
- package/dist/components/ai/AgentRequest/AgentRequest.js +435 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.d.ts +2 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.js +106 -0
- package/dist/components/ai/AgentRequest/AgentRequest.types.d.ts +241 -0
- package/dist/components/ai/AgentRequest/index.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.d.ts +3 -0
- package/dist/components/ai/AgentStatus/AgentStatus.js +144 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.d.ts +2 -0
- package/dist/components/ai/AgentStatus/AgentStatus.theme.js +37 -0
- package/dist/components/ai/AgentStatus/AgentStatus.types.d.ts +116 -0
- package/dist/components/ai/AgentStatus/index.d.ts +3 -0
- package/dist/components/ai/CodeBlock/CodeBlock.js +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +13 -14
- package/dist/components/ai/PromptInput/PromptInput.theme.js +3 -3
- package/dist/components/ai/PromptInput/VoiceRecorder.js +3 -3
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.d.ts +5 -0
- package/dist/components/ai/Reasoning/Reasoning.js +40 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.d.ts +6 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.js +36 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +73 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.d.ts +11 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.js +84 -0
- package/dist/components/ai/Reasoning/index.d.ts +3 -0
- package/dist/components/ai/SourceCitation/SourceCitation.d.ts +4 -0
- package/dist/components/ai/SourceCitation/SourceCitation.js +29 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.d.ts +2 -0
- package/dist/components/ai/SourceCitation/SourceCitation.theme.js +23 -0
- package/dist/components/ai/SourceCitation/SourceCitation.types.d.ts +55 -0
- package/dist/components/ai/SourceCitation/index.d.ts +3 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- package/dist/components/ai/StreamingResponse/ErrorDisplay.js +2 -2
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +2 -2
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +10 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +10 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +59 -33
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +14 -10
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +3 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +33 -2
- package/dist/components/ai/StreamingResponse/StreamingSurface.d.ts +13 -0
- package/dist/components/ai/StreamingResponse/StreamingSurface.js +38 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +5 -4
- package/dist/components/ai/StreamingResponse/index.d.ts +4 -2
- package/dist/components/ai/TokenCounter/TokenCounter.js +2 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/ai/index.d.ts +6 -2
- package/dist/components/ai/index.js +10 -3
- package/dist/components/ai/shared/StatusIndicator.d.ts +8 -0
- package/dist/components/ai/shared/StatusIndicator.js +34 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +2 -3
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +2 -3
- package/dist/components/canvas/NodeRenderer.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.js +4 -4
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +24 -35
- package/dist/components/charts/AreaChart/AreaChart.theme.d.ts +1 -6
- package/dist/components/charts/AreaChart/AreaChart.theme.js +10 -22
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +18 -11
- package/dist/components/charts/AreaChart/AreaChart.types.js +10 -3
- package/dist/components/charts/AreaChart/index.d.ts +1 -1
- package/dist/components/charts/BarChart/BarChart.js +13 -32
- package/dist/components/charts/BarChart/BarChart.types.d.ts +20 -16
- package/dist/components/charts/BarChart/BarChart.types.js +11 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +10 -7
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChart.js +11 -24
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +15 -13
- package/dist/components/charts/ComboChart/ComboChart.types.js +14 -2
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +16 -11
- package/dist/components/charts/ComboChart/LineRenderer.types.d.ts +1 -1
- package/dist/components/charts/DonutChart/DonutChart.theme.js +4 -4
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +49 -42
- package/dist/components/charts/Heatmap/Heatmap.theme.d.ts +6 -2
- package/dist/components/charts/Heatmap/Heatmap.theme.js +20 -8
- package/dist/components/charts/Heatmap/Heatmap.types.d.ts +49 -82
- package/dist/components/charts/Heatmap/HeatmapCell.js +30 -81
- package/dist/components/charts/Heatmap/HeatmapLegend.d.ts +7 -6
- package/dist/components/charts/Heatmap/HeatmapLegend.js +6 -6
- package/dist/components/charts/Heatmap/index.d.ts +1 -1
- package/dist/components/charts/Heatmap/utils/heatmapUtils.d.ts +7 -12
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +16 -61
- package/dist/components/charts/Heatmap/utils/heatmapUtils.test.d.ts +1 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.d.ts +16 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +237 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.d.ts +62 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.types.js +21 -0
- package/dist/components/charts/HorizontalBarChart/index.d.ts +3 -0
- package/dist/components/charts/LineChart/LineChart.js +11 -28
- package/dist/components/charts/LineChart/LineChart.types.d.ts +11 -14
- package/dist/components/charts/LineChart/LineChart.types.js +11 -3
- package/dist/components/charts/LollipopChart/LollipopChart.d.ts +3 -0
- package/dist/components/charts/LollipopChart/LollipopChart.js +361 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.d.ts +42 -0
- package/dist/components/charts/LollipopChart/LollipopChart.types.js +12 -0
- package/dist/components/charts/LollipopChart/index.d.ts +3 -0
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +151 -133
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +20 -18
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.js +10 -4
- package/dist/components/charts/hooks/useChartAccessibility.d.ts +1 -1
- package/dist/components/charts/hooks/useChartAccessibility.js +12 -6
- package/dist/components/charts/hooks/useTooltipPosition.js +18 -6
- package/dist/components/charts/index.d.ts +10 -8
- package/dist/components/charts/index.js +8 -4
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/CategoryYAxis.js +35 -0
- package/dist/components/charts/shared/ChartAxis/ChartAxis.types.d.ts +69 -8
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.d.ts +14 -0
- package/dist/components/charts/shared/ChartAxis/ValueXAxis.js +64 -0
- package/dist/components/charts/shared/ChartAxis/XAxis.js +1 -1
- package/dist/components/charts/shared/ChartAxis/YAxis.js +2 -2
- package/dist/components/charts/shared/ChartAxis/index.d.ts +3 -1
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.d.ts +0 -2
- package/dist/components/charts/shared/ChartGrid/HorizontalGrid.js +1 -1
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.d.ts +29 -0
- package/dist/components/charts/shared/ChartGrid/VerticalGrid.js +26 -0
- package/dist/components/charts/shared/ChartGrid/index.d.ts +2 -0
- package/dist/components/charts/shared/ChartMarker/ChartMarker.js +7 -1
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/index.d.ts +1 -1
- package/dist/components/charts/theme/chart.theme.js +21 -26
- package/dist/components/charts/types/chart.types.d.ts +9 -5
- package/dist/components/charts/types/chart.types.js +1 -7
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -21
- package/dist/components/charts/utils/bar-emphasis.d.ts +32 -3
- package/dist/components/charts/utils/bar-emphasis.js +24 -8
- package/dist/components/charts/utils/index.d.ts +1 -0
- package/dist/components/charts/utils/series-color.d.ts +7 -0
- package/dist/components/charts/utils/series-color.js +20 -0
- package/dist/components/core/Accordion/Accordion.theme.js +3 -3
- package/dist/components/core/Accordion/AccordionTrigger.js +2 -2
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -3
- package/dist/components/core/Alert/Alert.animations.js +30 -8
- package/dist/components/core/Alert/Alert.js +23 -9
- package/dist/components/core/Alert/Alert.theme.js +1 -1
- package/dist/components/core/Alert/Alert.types.d.ts +4 -2
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/Avatar/Avatar.js +50 -42
- package/dist/components/core/Avatar/Avatar.theme.d.ts +8 -4
- package/dist/components/core/Avatar/Avatar.theme.js +64 -8
- package/dist/components/core/Avatar/Avatar.types.d.ts +13 -2
- package/dist/components/core/Avatar/index.d.ts +1 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +6 -8
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.d.ts +1 -2
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +2 -6
- package/dist/components/core/AvatarGroup/AvatarGroup.types.d.ts +0 -6
- package/dist/components/core/AvatarGroup/index.d.ts +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -82
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +33 -65
- package/dist/components/core/Badge/Badge.theme.js +26 -24
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.d.ts +1 -4
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +6 -6
- package/dist/components/core/Button/Button.js +14 -58
- package/dist/components/core/Button/Button.theme.d.ts +2 -0
- package/dist/components/core/Button/Button.theme.js +35 -22
- package/dist/components/core/Button/Button.types.d.ts +26 -13
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.js +20 -5
- package/dist/components/core/Calendar/Calendar.theme.js +15 -23
- package/dist/components/core/Calendar/Calendar.types.d.ts +0 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.js +3 -3
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +2 -2
- package/dist/components/core/Card/Card.js +7 -2
- package/dist/components/core/Card/Card.theme.js +40 -4
- package/dist/components/core/Card/Card.types.d.ts +20 -0
- package/dist/components/core/Card/CardBody.js +9 -1
- package/dist/components/core/Card/CardContext.d.ts +13 -0
- package/dist/components/core/Card/CardContext.js +14 -0
- package/dist/components/core/Card/CardFooter.js +1 -1
- package/dist/components/core/Card/CardHeader.js +4 -1
- package/dist/components/core/CommandPalette/CommandPalette.js +5 -4
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +3 -7
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -0
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +4 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +8 -1
- package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuSub.d.ts +11 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.js +35 -22
- package/dist/components/core/ContextMenu/ContextMenuSubBody.js +14 -3
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +22 -9
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +7 -4
- package/dist/components/core/Drawer/DrawerHeader.js +2 -3
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -1
- package/dist/components/core/Dropdown/DropdownItem.js +2 -2
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Dropdown/DropdownTrigger.js +16 -5
- package/dist/components/core/HeroCard/HeroCard.theme.js +5 -2
- package/dist/components/core/Kbd/Kbd.theme.js +4 -2
- package/dist/components/core/Link/Link.js +7 -5
- package/dist/components/core/Masonry/Masonry.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -1
- package/dist/components/core/MenuItem/MenuItem.theme.js +13 -1
- package/dist/components/core/Message/Message.js +4 -2
- package/dist/components/core/Message/Message.theme.js +8 -10
- package/dist/components/core/Message/MessageAudio.js +2 -2
- package/dist/components/core/Message/MessageFile.js +2 -2
- package/dist/components/core/Message/MessageLink.js +2 -2
- package/dist/components/core/Message/MessageStatusIndicator.js +5 -5
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -1
- package/dist/components/core/Modal/Modal.animations.js +50 -11
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +6 -2
- package/dist/components/core/Modal/Modal.theme.js +9 -4
- package/dist/components/core/Modal/ModalHeader.js +2 -3
- package/dist/components/core/ModalStack/ModalStackModal.js +4 -2
- package/dist/components/core/NavItem/NavItem.js +8 -7
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.d.ts +22 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.animations.js +54 -0
- package/dist/components/core/OfflineIndicator/OfflineIndicator.js +23 -24
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +27 -6
- package/dist/components/core/OfflineIndicator/OfflineIndicator.types.d.ts +17 -0
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +2 -2
- package/dist/components/core/Pagination/Pagination.js +3 -3
- package/dist/components/core/Pagination/Pagination.theme.js +5 -5
- package/dist/components/core/Pill/Pill.js +5 -2
- package/dist/components/core/Pill/Pill.theme.js +9 -5
- package/dist/components/core/Popover/PopoverBody.js +16 -5
- package/dist/components/core/Progress/Progress.d.ts +0 -25
- package/dist/components/core/Progress/Progress.js +79 -11
- package/dist/components/core/Progress/Progress.theme.js +17 -0
- package/dist/components/core/Progress/Progress.types.d.ts +47 -1
- package/dist/components/core/Rating/Rating.js +4 -5
- package/dist/components/core/Rating/Rating.theme.js +2 -2
- package/dist/components/core/Rating/Rating.types.d.ts +3 -2
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +10 -7
- package/dist/components/core/Segmented/SegmentedContext.js +1 -0
- package/dist/components/core/Sidebar/Sidebar.js +5 -2
- package/dist/components/core/Sidebar/Sidebar.theme.js +2 -2
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +4 -2
- package/dist/components/core/Sidebar/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +3 -3
- package/dist/components/core/Sidebar/SidebarMobileTrigger.js +2 -2
- package/dist/components/core/Sidebar/SidebarSearch.js +4 -4
- package/dist/components/core/Sidebar/SidebarToggle.js +3 -3
- package/dist/components/core/Sidebar/SidebarUserProfile.js +3 -3
- package/dist/components/core/Sortable/Sortable.js +2 -2
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +1 -1
- package/dist/components/core/Tag/Tag.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +5 -3
- package/dist/components/core/Toast/Toast.js +3 -3
- package/dist/components/core/Toast/Toast.types.d.ts +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- package/dist/components/core/Toast/useToast.js +5 -5
- package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/core/Tooltip/Tooltip.js +42 -10
- package/dist/components/core/Tooltip/Tooltip.types.d.ts +25 -0
- package/dist/components/core/Tree/Tree.js +2 -2
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +0 -2
- package/dist/components/core/index.js +0 -4
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.d.ts +4 -0
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.js +20 -0
- package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/core/shared/Ripple.d.ts +16 -0
- package/dist/components/core/shared/Ripple.js +141 -0
- package/dist/components/core/shared/interaction.animations.d.ts +51 -0
- package/dist/components/core/shared/interaction.animations.js +59 -0
- package/dist/components/data-display/Feed/Feed.js +2 -2
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +7 -7
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +3 -3
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -3
- package/dist/components/data-display/KPI/KPI.js +12 -21
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.js +2 -2
- package/dist/components/data-display/Metric/Metric.theme.js +25 -8
- package/dist/components/data-display/Metric/Metric.types.d.ts +1 -1
- package/dist/components/data-display/Table/Table.theme.js +11 -11
- package/dist/components/data-display/Table/TableActions.js +2 -2
- package/dist/components/data-display/Table/TableActionsMenu.js +1 -1
- package/dist/components/data-display/Table/TableColumnManager.js +2 -3
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableDeclarative.js +3 -3
- package/dist/components/data-display/Table/TableFilter.js +13 -6
- package/dist/components/data-display/Table/TableHeader.js +3 -3
- package/dist/components/data-display/Table/TableRow.js +2 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +4 -4
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/data-display/Timeline/TimelineMarker.js +2 -2
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +3 -3
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- package/dist/components/effects/DotPattern/DotPattern.js +6 -0
- package/dist/components/effects/DotPattern/DotPattern.types.d.ts +4 -2
- package/dist/components/effects/MeshGradient/MeshGradient.utils.d.ts +1 -1
- package/dist/components/effects/MeshGradient/MeshGradient.utils.js +1 -1
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +1 -1
- package/dist/components/effects/Overlay/Overlay.js +7 -3
- package/dist/components/effects/index.d.ts +0 -32
- package/dist/components/effects/index.js +0 -16
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.d.ts +0 -2
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.js +1 -93
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.types.d.ts +0 -10
- package/dist/components/effects/shared/ShaderCanvas/index.d.ts +1 -1
- package/dist/components/effects/shared/index.d.ts +1 -3
- package/dist/components/effects/shared/shaderNoise.glsl.d.ts +1 -1
- package/dist/components/effects/shared/shaderNoise.glsl.js +2 -11
- package/dist/components/forms/Checkbox/Checkbox.js +2 -1
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerEyeDropper.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerGradient.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +3 -3
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerPresets.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerSavedColors.js +2 -2
- package/dist/components/forms/Combobox/Combobox.js +5 -3
- package/dist/components/forms/Combobox/Combobox.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePicker.animations.js +16 -25
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/DatePicker/DatePickerBody.js +1 -1
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +4 -4
- package/dist/components/forms/DateRangePicker/DateRangePickerBody.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerPresets.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +4 -4
- package/dist/components/forms/FileUpload/FileUpload.theme.js +7 -3
- package/dist/components/forms/FileUpload/FileUploadProgress.js +7 -7
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/Input/Input.js +6 -7
- package/dist/components/forms/Input/Input.theme.js +19 -15
- package/dist/components/forms/InputAddress/InputAddress.js +10 -3
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
- package/dist/components/forms/InputCounter/InputCounter.js +3 -3
- package/dist/components/forms/InputOTP/InputOTP.d.ts +3 -12
- package/dist/components/forms/InputOTP/InputOTP.js +140 -151
- package/dist/components/forms/InputOTP/InputOTP.theme.d.ts +5 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +40 -5
- package/dist/components/forms/InputOTP/InputOTP.types.d.ts +45 -2
- package/dist/components/forms/InputOTP/index.d.ts +1 -1
- package/dist/components/forms/InputTag/InputTag.js +5 -5
- package/dist/components/forms/InputTag/InputTag.theme.js +1 -2
- package/dist/components/forms/Mention/Mention.theme.js +3 -5
- package/dist/components/forms/Radio/Radio.js +3 -2
- package/dist/components/forms/Radio/Radio.theme.js +3 -3
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1681
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +12 -56
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +60 -118
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +62 -126
- package/dist/components/forms/RichTextEditor/RichTextLinkField.d.ts +18 -0
- package/dist/components/forms/RichTextEditor/RichTextLinkField.js +46 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.d.ts +15 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.js +93 -0
- package/dist/components/forms/RichTextEditor/editorCommands.d.ts +50 -0
- package/dist/components/forms/RichTextEditor/editorCommands.js +58 -0
- package/dist/components/forms/RichTextEditor/editorState.d.ts +19 -0
- package/dist/components/forms/RichTextEditor/editorState.js +103 -0
- package/dist/components/forms/RichTextEditor/index.d.ts +5 -3
- package/dist/components/forms/RichTextEditor/sanitizeHtml.d.ts +38 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.js +179 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.test.d.ts +1 -0
- package/dist/components/forms/Select/Select.d.ts +5 -1
- package/dist/components/forms/Select/Select.js +14 -13
- package/dist/components/forms/Select/Select.theme.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +74 -8
- package/dist/components/forms/Select/useSelectState.d.ts +9 -3
- package/dist/components/forms/Select/useSelectState.js +4 -1
- package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +1 -2
- package/dist/components/forms/SelectableCard/SelectableCard.animations.js +6 -7
- package/dist/components/forms/SelectableCard/SelectableCard.js +3 -2
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Signature/Signature.js +1 -1
- package/dist/components/forms/Slider/Slider.js +24 -11
- package/dist/components/forms/Slider/Slider.theme.js +9 -3
- package/dist/components/forms/Switch/Switch.theme.js +3 -3
- package/dist/components/forms/TimePicker/TimePicker.theme.js +7 -8
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +3 -3
- package/dist/components/forms/forms.theme.js +38 -13
- package/dist/components/forms/index.js +2 -1
- package/dist/components/generative/FormShell.d.ts +22 -0
- package/dist/components/generative/FormShell.js +102 -0
- package/dist/components/generative/GenerativeView.d.ts +52 -1
- package/dist/components/generative/GenerativeView.js +203 -11
- package/dist/components/generative/actions.d.ts +5 -0
- package/dist/components/generative/ai-sdk/index.d.ts +1 -0
- package/dist/components/generative/ai-sdk/index.js +1 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.d.ts +52 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.js +73 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.test.d.ts +1 -0
- package/dist/components/generative/fieldBinding.d.ts +31 -0
- package/dist/components/generative/fieldBinding.js +33 -0
- package/dist/components/generative/fieldBinding.test.d.ts +1 -0
- package/dist/components/generative/formScope.d.ts +71 -0
- package/dist/components/generative/formScope.js +135 -0
- package/dist/components/generative/index.d.ts +4 -0
- package/dist/components/generative/index.js +4 -0
- package/dist/components/generative/registry.d.ts +2 -0
- package/dist/components/generative/registry.js +197 -4
- package/dist/components/generative/resolvers.js +16 -16
- package/dist/components/generative/schema.generated.js +2522 -328
- package/dist/components/generative/toToolResult.d.ts +21 -0
- package/dist/components/generative/toToolResult.js +15 -0
- package/dist/components/generative/toToolResult.test.d.ts +1 -0
- package/dist/components/generative/validate.d.ts +10 -1
- package/dist/components/generative/validate.js +126 -11
- package/dist/components/layout/Grid/Grid.js +1 -0
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/components/layout/Stack/Stack.js +1 -0
- package/dist/generative.schema.json +2522 -328
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useElapsedTime.d.ts +28 -0
- package/dist/hooks/useElapsedTime.js +37 -0
- package/dist/hooks/useSelectPortal.d.ts +10 -2
- package/dist/hooks/useSelectPortal.js +6 -3
- package/dist/index.js +2 -5
- package/dist/registry.json +3262 -2464
- package/dist/shadcn-compat.css +6 -6
- package/dist/styles/theme.test.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/test/render.d.ts +17 -0
- package/dist/theme.css +5 -1
- package/dist/themes/ember.css +131 -0
- package/dist/themes/iris.css +94 -0
- package/dist/themes/jade.css +139 -0
- package/dist/themes/precision.css +232 -0
- package/dist/tools.json +2557 -328
- package/dist/utils/colorUtils.d.ts +6 -6
- package/dist/utils/colorUtils.js +8 -8
- package/dist/utils/index.d.ts +0 -1
- package/package.json +39 -6
- package/src/global.scss +32 -28
- package/src/styles/theme.css +547 -176
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +66 -38
- package/dist/components/charts/FunnelChart/FunnelChart.animations.d.ts +0 -35
- package/dist/components/charts/FunnelChart/FunnelChart.animations.js +0 -59
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +0 -8
- package/dist/components/charts/FunnelChart/FunnelChart.js +0 -410
- package/dist/components/charts/FunnelChart/FunnelChart.theme.d.ts +0 -2
- package/dist/components/charts/FunnelChart/FunnelChart.theme.js +0 -12
- package/dist/components/charts/FunnelChart/FunnelChart.types.d.ts +0 -105
- package/dist/components/charts/FunnelChart/index.d.ts +0 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +0 -9
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +0 -207
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.d.ts +0 -18
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +0 -42
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +0 -65
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -12
- package/dist/components/charts/ScatterPlot/index.d.ts +0 -3
- package/dist/components/core/Button/Button.ripple.d.ts +0 -71
- package/dist/components/core/Button/Button.ripple.js +0 -236
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.d.ts +0 -4
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.theme.d.ts +0 -12
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.types.d.ts +0 -23
- package/dist/components/core/Calendar/CalendarEvent/index.d.ts +0 -2
- package/dist/components/core/CardStack/CardStack.animations.d.ts +0 -47
- package/dist/components/core/CardStack/CardStack.d.ts +0 -3
- package/dist/components/core/CardStack/CardStack.js +0 -187
- package/dist/components/core/CardStack/CardStack.theme.d.ts +0 -6
- package/dist/components/core/CardStack/CardStack.theme.js +0 -33
- package/dist/components/core/CardStack/CardStack.types.d.ts +0 -139
- package/dist/components/core/CardStack/index.d.ts +0 -7
- package/dist/components/core/Carousel/Carousel.d.ts +0 -3
- package/dist/components/core/Carousel/Carousel.js +0 -83
- package/dist/components/core/Carousel/Carousel.theme.d.ts +0 -10
- package/dist/components/core/Carousel/Carousel.theme.js +0 -20
- package/dist/components/core/Carousel/Carousel.types.d.ts +0 -113
- package/dist/components/core/Carousel/CarouselBody.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselBody.js +0 -59
- package/dist/components/core/Carousel/CarouselContext.d.ts +0 -3
- package/dist/components/core/Carousel/CarouselContext.js +0 -13
- package/dist/components/core/Carousel/CarouselItem.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselItem.js +0 -11
- package/dist/components/core/Carousel/CarouselNext.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselNext.js +0 -16
- package/dist/components/core/Carousel/CarouselPrevious.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselPrevious.js +0 -16
- package/dist/components/core/Carousel/index.d.ts +0 -3
- package/dist/components/core/Pill/Pill.animations.d.ts +0 -32
- package/dist/components/core/Pill/Pill.animations.js +0 -16
- package/dist/components/effects/ColorPanels/ColorPanels.d.ts +0 -8
- package/dist/components/effects/ColorPanels/ColorPanels.js +0 -66
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.d.ts +0 -12
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.js +0 -218
- package/dist/components/effects/ColorPanels/ColorPanels.types.d.ts +0 -29
- package/dist/components/effects/ColorPanels/ColorPanels.types.js +0 -3
- package/dist/components/effects/ColorPanels/index.d.ts +0 -2
- package/dist/components/effects/FlutedGlass/FlutedGlass.d.ts +0 -9
- package/dist/components/effects/FlutedGlass/FlutedGlass.js +0 -80
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.d.ts +0 -12
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.js +0 -335
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.d.ts +0 -61
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.js +0 -16
- package/dist/components/effects/FlutedGlass/index.d.ts +0 -3
- package/dist/components/effects/GlassEffect/GlassEffect.d.ts +0 -15
- package/dist/components/effects/GlassEffect/GlassEffect.js +0 -38
- package/dist/components/effects/GlassEffect/GlassEffect.types.d.ts +0 -19
- package/dist/components/effects/GlassEffect/index.d.ts +0 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +0 -8
- package/dist/components/effects/GlassSurface/GlassSurface.js +0 -250
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +0 -66
- package/dist/components/effects/GlassSurface/index.d.ts +0 -2
- package/dist/components/effects/GodRays/GodRays.d.ts +0 -8
- package/dist/components/effects/GodRays/GodRays.js +0 -68
- package/dist/components/effects/GodRays/GodRays.shaders.d.ts +0 -10
- package/dist/components/effects/GodRays/GodRays.shaders.js +0 -128
- package/dist/components/effects/GodRays/GodRays.types.d.ts +0 -25
- package/dist/components/effects/GodRays/GodRays.types.js +0 -3
- package/dist/components/effects/GodRays/index.d.ts +0 -2
- package/dist/components/effects/GridPattern/GridPattern.d.ts +0 -18
- package/dist/components/effects/GridPattern/GridPattern.js +0 -65
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +0 -47
- package/dist/components/effects/GridPattern/index.d.ts +0 -2
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.d.ts +0 -10
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.js +0 -78
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.d.ts +0 -22
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.js +0 -239
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.types.d.ts +0 -52
- package/dist/components/effects/HalftoneCmyk/index.d.ts +0 -2
- package/dist/components/effects/HalftoneDots/HalftoneDots.d.ts +0 -9
- package/dist/components/effects/HalftoneDots/HalftoneDots.js +0 -68
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.d.ts +0 -13
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.js +0 -296
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.d.ts +0 -43
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.js +0 -12
- package/dist/components/effects/HalftoneDots/index.d.ts +0 -3
- package/dist/components/effects/ImageDithering/ImageDithering.d.ts +0 -9
- package/dist/components/effects/ImageDithering/ImageDithering.js +0 -68
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.d.ts +0 -12
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.js +0 -117
- package/dist/components/effects/ImageDithering/ImageDithering.types.d.ts +0 -30
- package/dist/components/effects/ImageDithering/ImageDithering.types.js +0 -8
- package/dist/components/effects/ImageDithering/index.d.ts +0 -3
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +0 -30
- package/dist/components/effects/MagneticElement/MagneticElement.js +0 -111
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +0 -44
- package/dist/components/effects/MagneticElement/index.d.ts +0 -2
- package/dist/components/effects/Metaballs/Metaballs.d.ts +0 -8
- package/dist/components/effects/Metaballs/Metaballs.js +0 -59
- package/dist/components/effects/Metaballs/Metaballs.shaders.d.ts +0 -10
- package/dist/components/effects/Metaballs/Metaballs.shaders.js +0 -102
- package/dist/components/effects/Metaballs/Metaballs.types.d.ts +0 -16
- package/dist/components/effects/Metaballs/Metaballs.types.js +0 -3
- package/dist/components/effects/Metaballs/index.d.ts +0 -2
- package/dist/components/effects/PaperTexture/PaperTexture.d.ts +0 -9
- package/dist/components/effects/PaperTexture/PaperTexture.js +0 -61
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.d.ts +0 -22
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.js +0 -145
- package/dist/components/effects/PaperTexture/PaperTexture.types.d.ts +0 -19
- package/dist/components/effects/PaperTexture/index.d.ts +0 -2
- package/dist/components/effects/PulsingBorder/PulsingBorder.d.ts +0 -27
- package/dist/components/effects/PulsingBorder/PulsingBorder.js +0 -174
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.d.ts +0 -14
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.js +0 -258
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.d.ts +0 -75
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.js +0 -3
- package/dist/components/effects/PulsingBorder/index.d.ts +0 -2
- package/dist/components/effects/SmokeRing/SmokeRing.d.ts +0 -8
- package/dist/components/effects/SmokeRing/SmokeRing.js +0 -62
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.d.ts +0 -14
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.js +0 -130
- package/dist/components/effects/SmokeRing/SmokeRing.types.d.ts +0 -22
- package/dist/components/effects/SmokeRing/SmokeRing.types.js +0 -3
- package/dist/components/effects/SmokeRing/index.d.ts +0 -2
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.d.ts +0 -9
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.js +0 -59
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.d.ts +0 -14
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.js +0 -129
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.d.ts +0 -23
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.js +0 -3
- package/dist/components/effects/StaticGradientMesh/index.d.ts +0 -2
- package/dist/components/effects/Water/Water.d.ts +0 -9
- package/dist/components/effects/Water/Water.js +0 -65
- package/dist/components/effects/Water/Water.shaders.d.ts +0 -11
- package/dist/components/effects/Water/Water.shaders.js +0 -123
- package/dist/components/effects/Water/Water.types.d.ts +0 -25
- package/dist/components/effects/Water/index.d.ts +0 -2
- package/dist/components/effects/shared/bayerMatrices.glsl.d.ts +0 -10
- package/dist/components/effects/shared/bayerMatrices.glsl.js +0 -44
- package/dist/components/effects/shared/imageUV.glsl.d.ts +0 -12
- package/dist/components/effects/shared/imageUV.glsl.js +0 -26
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.d.ts +0 -7
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.js +0 -32
- package/dist/utils/calendarUtils.d.ts +0 -60
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.js +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.types.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltipContent.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/index.d.ts +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useRef, useMemo } from 'react';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useId, useMemo } from 'react';
|
|
4
4
|
import { motion } from 'motion/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { useTooltipPosition } from '../hooks/useTooltipPosition.js';
|
|
7
7
|
import { useOptionalChart } from '../ChartContainer.js';
|
|
8
|
-
import { ChartTooltip } from '
|
|
8
|
+
import { ChartTooltip } from '../../core/shared/ChartTooltip/ChartTooltip.js';
|
|
9
9
|
import { HeatmapCell } from './HeatmapCell.js';
|
|
10
10
|
import { processHeatmapData, createGridMatrix, calculateIntensity, getDefaultTooltipContent } from './utils/heatmapUtils.js';
|
|
11
11
|
import { HeatmapLegend } from './HeatmapLegend.js';
|
|
12
12
|
import { heatmapTheme } from './Heatmap.theme.js';
|
|
13
|
+
import { HEATMAP_CELL_FADE_DURATION, heatmapCellDelay } from '../utils/animation-utils.js';
|
|
14
|
+
import { useMediaQuery } from '../../../hooks/useMediaQuery.js';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Heatmap component for visualizing data in a grid format with color intensity
|
|
16
18
|
* Supports weekly, monthly, hourly views and custom data structures
|
|
17
19
|
*/
|
|
18
|
-
const Heatmap = ({ data: dataProp, config: configProp, color = 'primary',
|
|
20
|
+
const Heatmap = ({ data: dataProp, config: configProp, color = 'primary', variant = 'default', showXAxis = true, showYAxis = true, xAxisFormatter, yAxisFormatter, legend = 'bottom', legendLabels, minValue: minValueProp, maxValue: maxValueProp, cellGap = 6, minOpacity = 0.1, showTooltip = true, tooltipFormatter, onCellClick, cellRenderer, className, width, height, title, description, children, }) => {
|
|
21
|
+
var _a;
|
|
19
22
|
// Get data and config from context if not provided as props. `data`/`config`
|
|
20
23
|
// are documented as directly-passable — Heatmap must also work standalone,
|
|
21
24
|
// with no wrapping <ChartContainer>, so the context read is optional here
|
|
@@ -24,18 +27,20 @@ const Heatmap = ({ data: dataProp, config: configProp, color = 'primary', colorS
|
|
|
24
27
|
const data = dataProp || (chartContext === null || chartContext === void 0 ? void 0 : chartContext.data) || [];
|
|
25
28
|
const config = configProp || (chartContext === null || chartContext === void 0 ? void 0 : chartContext.config) || {};
|
|
26
29
|
const containerRef = useRef(null);
|
|
27
|
-
//
|
|
28
|
-
const isMobile =
|
|
29
|
-
('ontouchstart' in window || navigator.maxTouchPoints > 0);
|
|
30
|
+
// §11: no window access in the render body. A coarse pointer is the touch signal.
|
|
31
|
+
const isMobile = useMediaQuery('(pointer: coarse)');
|
|
30
32
|
// Use the new tooltip positioning hook
|
|
31
33
|
const { tooltipData, tooltipRef, handleMouseEnter, handleMouseMove, handleMouseLeave, } = useTooltipPosition({
|
|
32
34
|
containerRef,
|
|
33
35
|
isMobile,
|
|
34
36
|
});
|
|
37
|
+
const descriptionId = useId();
|
|
38
|
+
const xAxisDescriptionId = useId();
|
|
39
|
+
const yAxisDescriptionId = useId();
|
|
35
40
|
// Process data
|
|
36
41
|
const processedData = useMemo(() => {
|
|
37
|
-
return processHeatmapData(data,
|
|
38
|
-
}, [data,
|
|
42
|
+
return processHeatmapData(data, minValueProp, maxValueProp);
|
|
43
|
+
}, [data, minValueProp, maxValueProp]);
|
|
39
44
|
const { xCategories, yCategories, minValue, maxValue } = processedData;
|
|
40
45
|
// Create grid matrix
|
|
41
46
|
const gridMatrix = useMemo(() => {
|
|
@@ -62,24 +67,22 @@ const Heatmap = ({ data: dataProp, config: configProp, color = 'primary', colorS
|
|
|
62
67
|
return `var(--color-${color})`;
|
|
63
68
|
};
|
|
64
69
|
const cellColor = getCellColor();
|
|
65
|
-
|
|
66
|
-
const handleCellHover = (
|
|
67
|
-
if (!
|
|
70
|
+
const seriesLabel = (_a = config === null || config === void 0 ? void 0 : config.value) === null || _a === void 0 ? void 0 : _a.label;
|
|
71
|
+
const handleCellHover = (cell, event) => {
|
|
72
|
+
if (!showTooltip)
|
|
68
73
|
return;
|
|
69
|
-
const content =
|
|
70
|
-
?
|
|
71
|
-
: getDefaultTooltipContent(
|
|
74
|
+
const content = tooltipFormatter
|
|
75
|
+
? tooltipFormatter(cell)
|
|
76
|
+
: getDefaultTooltipContent(cell, seriesLabel);
|
|
72
77
|
handleMouseEnter(event, content);
|
|
73
78
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (!tooltip.enabled || !tooltipData)
|
|
79
|
+
const handleCellMouseMove = (_cell, event) => {
|
|
80
|
+
if (!showTooltip || !tooltipData)
|
|
77
81
|
return;
|
|
78
82
|
handleMouseMove(event);
|
|
79
83
|
};
|
|
80
|
-
// Handle cell leave using new tooltip system
|
|
81
84
|
const handleCellLeave = () => {
|
|
82
|
-
if (!
|
|
85
|
+
if (!showTooltip)
|
|
83
86
|
return;
|
|
84
87
|
handleMouseLeave();
|
|
85
88
|
};
|
|
@@ -88,38 +91,42 @@ const Heatmap = ({ data: dataProp, config: configProp, color = 'primary', colorS
|
|
|
88
91
|
display: 'grid',
|
|
89
92
|
gridTemplateColumns: `repeat(${xCategories.length}, 1fr)`,
|
|
90
93
|
gridTemplateRows: `repeat(${yCategories.length}, 1fr)`,
|
|
91
|
-
gap: typeof
|
|
94
|
+
gap: typeof cellGap === 'number' ? `${cellGap}px` : cellGap,
|
|
92
95
|
width: '100%',
|
|
93
96
|
height: '100%',
|
|
94
97
|
};
|
|
95
98
|
// Render axis labels - using theme for base styles
|
|
96
99
|
const renderXAxisLabels = () => {
|
|
97
|
-
if (!
|
|
100
|
+
if (!showXAxis)
|
|
98
101
|
return null;
|
|
99
|
-
return (jsxs("div", { className: cn("flex justify-between items-center px-1 py-2", heatmapTheme.axisLabelStyle), style: { gridColumn: `1 / -1` }, role: xCategories.length > 0 ? "list" : undefined, "aria-label": "X-axis labels", "aria-describedby":
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
: String(category)}`, children: axis.xAxisFormatter
|
|
104
|
-
? axis.xAxisFormatter(category, index)
|
|
105
|
-
: String(category) }, category))), jsxs("span", { id: "heatmap-x-axis-description", className: "sr-only", children: ["X-axis contains ", xCategories.length, " categories representing the horizontal dimension of the heatmap"] })] }));
|
|
102
|
+
return (jsxs("div", { className: cn("flex justify-between items-center px-1 py-2", heatmapTheme.axisLabelStyle), style: { gridColumn: `1 / -1` }, role: xCategories.length > 0 ? "list" : undefined, "aria-label": "X-axis labels", "aria-describedby": xAxisDescriptionId, children: [xCategories.map((category, index) => {
|
|
103
|
+
const label = xAxisFormatter ? xAxisFormatter(category, index) : String(category);
|
|
104
|
+
return (jsx("div", { className: "flex-1 text-center px-1", role: "listitem", "aria-label": `X-axis label: ${label}`, children: label }, category));
|
|
105
|
+
}), jsxs("span", { id: xAxisDescriptionId, className: "sr-only", children: ["X-axis contains ", xCategories.length, " categories representing the horizontal dimension of the heatmap"] })] }));
|
|
106
106
|
};
|
|
107
107
|
const renderYAxisLabels = () => {
|
|
108
|
-
if (!
|
|
108
|
+
if (!showYAxis)
|
|
109
109
|
return null;
|
|
110
110
|
return (jsxs("div", { className: cn("grid pr-3", heatmapTheme.axisLabelStyle), style: {
|
|
111
111
|
gridTemplateRows: `repeat(${yCategories.length}, 1fr)`,
|
|
112
|
-
gap: typeof
|
|
112
|
+
gap: typeof cellGap === 'number' ? `${cellGap}px` : cellGap,
|
|
113
113
|
height: '100%',
|
|
114
|
-
}, role: yCategories.length > 0 ? "list" : undefined, "aria-label": "Y-axis labels", "aria-describedby":
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
: String(category)}`, children: axis.yAxisFormatter
|
|
119
|
-
? axis.yAxisFormatter(category, index)
|
|
120
|
-
: String(category) }, category))), jsxs("span", { id: "heatmap-y-axis-description", className: "sr-only", children: ["Y-axis contains ", yCategories.length, " categories representing the vertical dimension of the heatmap"] })] }));
|
|
114
|
+
}, role: yCategories.length > 0 ? "list" : undefined, "aria-label": "Y-axis labels", "aria-describedby": yAxisDescriptionId, children: [yCategories.map((category, index) => {
|
|
115
|
+
const label = yAxisFormatter ? yAxisFormatter(category, index) : String(category);
|
|
116
|
+
return (jsx("div", { className: "flex items-center justify-end", role: "listitem", "aria-label": `Y-axis label: ${label}`, children: label }, category));
|
|
117
|
+
}), jsxs("span", { id: yAxisDescriptionId, className: "sr-only", children: ["Y-axis contains ", yCategories.length, " categories representing the vertical dimension of the heatmap"] })] }));
|
|
121
118
|
};
|
|
122
|
-
|
|
119
|
+
const legendNode = legend !== 'none' ? (jsx("div", { className: "flex-shrink-0", children: jsx(HeatmapLegend, { color: cellColor, labels: legendLabels,
|
|
120
|
+
// heatmapTheme.legendStyle's `mt-3` assumes the legend sits below the
|
|
121
|
+
// grid (the default, bottom position). Above the grid, that top
|
|
122
|
+
// margin is backwards — cancel it and add the matching bottom margin
|
|
123
|
+
// instead so the gap is always between the legend and the grid, not
|
|
124
|
+
// duplicated on one side and missing on the other.
|
|
125
|
+
className: legend === 'top' ? 'mt-0 mb-3' : undefined }) })) : null;
|
|
126
|
+
return (jsxs("div", { ref: containerRef, className: cn(heatmapTheme.containerStyle, heatmapTheme.variants[variant], className), style: {
|
|
127
|
+
width: width !== undefined ? (typeof width === 'number' ? `${width}px` : width) : undefined,
|
|
128
|
+
height: height !== undefined ? (typeof height === 'number' ? `${height}px` : height) : undefined,
|
|
129
|
+
}, children: [legend === 'top' && legendNode, jsxs("div", { className: "flex flex-1 min-h-0", children: [showYAxis && (jsxs("div", { className: "flex-shrink-0 w-16 flex flex-col", children: [showXAxis && jsx("div", { className: "flex-shrink-0 h-8" }), jsx("div", { className: "flex-1", children: renderYAxisLabels() })] })), jsxs("div", { className: "flex-1 flex flex-col min-w-0", children: [showXAxis && (jsx("div", { className: "flex-shrink-0 h-8", children: renderXAxisLabels() })), jsx("div", { className: "flex-1 relative min-h-0", children: jsx(motion.div, { style: gridStyles, initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: HEATMAP_CELL_FADE_DURATION, ease: 'easeOut' }, className: heatmapTheme.gridStyle, role: "grid", "aria-label": title !== null && title !== void 0 ? title : `Heatmap grid, ${yCategories.length} rows by ${xCategories.length} columns`, "aria-describedby": description ? descriptionId : undefined, children: gridMatrix.map((rowCells, rowIndex) => (
|
|
123
130
|
// `role="row"` groups each grid-matrix row for ARIA purposes
|
|
124
131
|
// (satisfies aria-required-parent on the gridcells below and
|
|
125
132
|
// aria-required-children on the grid above) without affecting
|
|
@@ -131,11 +138,11 @@ const Heatmap = ({ data: dataProp, config: configProp, color = 'primary', colorS
|
|
|
131
138
|
const index = rowIndex * rowCells.length + colIndex;
|
|
132
139
|
// Skip null values entirely
|
|
133
140
|
if (cellData.value === null) {
|
|
134
|
-
return (jsx("div", { className:
|
|
141
|
+
return (jsx("div", { className: heatmapTheme.cellNullStyle }, `${cellData.x}-${cellData.y}-${index}`));
|
|
135
142
|
}
|
|
136
143
|
const CellComponent = cellRenderer || HeatmapCell;
|
|
137
|
-
return (jsx(CellComponent, { data: cellData, intensity: intensity, minOpacity:
|
|
138
|
-
}) }, `row-${rowIndex}`))) }) })] })] }),
|
|
144
|
+
return (jsx(CellComponent, { data: cellData, intensity: intensity, minOpacity: minOpacity, color: cellColor, delay: heatmapCellDelay(rowIndex, colIndex), onClick: onCellClick, onHover: handleCellHover, onMouseMove: handleCellMouseMove, onLeave: handleCellLeave }, `${cellData.x}-${cellData.y}-${index}`));
|
|
145
|
+
}) }, `row-${rowIndex}`))) }) })] })] }), legend === 'bottom' && legendNode, showTooltip && (jsx(ChartTooltip, { content: tooltipData === null || tooltipData === void 0 ? void 0 : tooltipData.content, active: !!tooltipData, position: tooltipData ? { x: tooltipData.x, y: tooltipData.y } : { x: 0, y: 0 }, tooltipRef: tooltipRef })), description && (jsx("span", { id: descriptionId, className: "sr-only", children: description })), children] }));
|
|
139
146
|
};
|
|
140
147
|
|
|
141
148
|
export { Heatmap };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Heatmap theme configuration
|
|
3
|
-
*
|
|
2
|
+
* Heatmap theme configuration.
|
|
3
|
+
* CSS variables only (CLAUDE.md §3) — no raw Tailwind greys.
|
|
4
4
|
*/
|
|
5
|
+
import type { HeatmapVariant } from "./Heatmap.types";
|
|
5
6
|
export interface HeatmapTheme {
|
|
6
7
|
containerStyle: string;
|
|
8
|
+
variants: Record<HeatmapVariant, string>;
|
|
7
9
|
gridStyle: string;
|
|
8
10
|
cellBaseStyle: string;
|
|
11
|
+
cellNullStyle: string;
|
|
12
|
+
cellOverlayStyle: string;
|
|
9
13
|
axisLabelStyle: string;
|
|
10
14
|
legendStyle: string;
|
|
11
15
|
}
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Heatmap theme configuration
|
|
3
|
-
*
|
|
2
|
+
* Heatmap theme configuration.
|
|
3
|
+
* CSS variables only (CLAUDE.md §3) — no raw Tailwind greys.
|
|
4
4
|
*/
|
|
5
5
|
const heatmapTheme = {
|
|
6
|
-
// Container with variants handled inline
|
|
7
6
|
containerStyle: "relative w-full h-full min-h-[200px] flex flex-col",
|
|
8
|
-
//
|
|
7
|
+
// `default` adds nothing; `minimal` tightens the frame.
|
|
8
|
+
variants: {
|
|
9
|
+
default: "",
|
|
10
|
+
minimal: "p-2",
|
|
11
|
+
},
|
|
12
|
+
// Grid container (CSS Grid template comes from inline styles).
|
|
9
13
|
gridStyle: "absolute inset-0",
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
//
|
|
14
|
+
// Cells: motion owns opacity and transform, so the CSS transition lists
|
|
15
|
+
// background-color only — a `transition-all` here re-interpolates the
|
|
16
|
+
// hover/tap scale every frame (CLAUDE.md §12).
|
|
17
|
+
cellBaseStyle: "relative w-full h-full rounded-sm border border-transparent transition-[background-color] duration-[var(--motion-duration-fast)]",
|
|
18
|
+
// Missing data: a hairline well, never a painted cell. `border` supplies the
|
|
19
|
+
// width — `border-[var(--color-border)]` alone only sets border-color, and
|
|
20
|
+
// Tailwind's preflight zeroes border-width by default, so without it this
|
|
21
|
+
// painted nothing (this style is applied standalone by the parent's null
|
|
22
|
+
// branch, not merged with cellBaseStyle's own `border` utility).
|
|
23
|
+
cellNullStyle: "bg-transparent border border-[var(--color-border)]",
|
|
24
|
+
// Optional content rendered inside a cell.
|
|
25
|
+
cellOverlayStyle: "absolute inset-0 flex items-center justify-center text-sm font-medium text-[var(--color-text-primary)]",
|
|
13
26
|
axisLabelStyle: "text-xs text-[var(--color-text-secondary)] font-medium select-none",
|
|
14
|
-
// Legend using correct CSS variables
|
|
15
27
|
legendStyle: "w-full space-y-1.5 mt-3",
|
|
16
28
|
};
|
|
17
29
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseChartProps, ChartConfig } from '../types/chart.types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type SemanticColor = 'primary' | 'success' | 'warning' | 'danger';
|
|
2
|
+
import { BaseChartProps, ChartConfig, ChartLegendPosition, StandardChartDisplayProps } from '../types/chart.types';
|
|
3
|
+
import type { SemanticColor } from '../../../utils/colorUtils';
|
|
4
|
+
/** Heatmap has no gradient fill, so it narrows the family's ChartVariant. */
|
|
5
|
+
export type HeatmapVariant = 'default' | 'minimal';
|
|
7
6
|
/**
|
|
8
7
|
* Heatmap data point structure
|
|
9
8
|
* @property {string | number} x - X-axis category (e.g., day, month, hour)
|
|
@@ -25,6 +24,8 @@ export interface HeatmapCellProps {
|
|
|
25
24
|
intensity: number;
|
|
26
25
|
minOpacity?: number;
|
|
27
26
|
color?: string;
|
|
27
|
+
/** Entrance delay in seconds, computed by the parent from the cell's grid position */
|
|
28
|
+
delay?: number;
|
|
28
29
|
className?: string;
|
|
29
30
|
onClick?: (data: HeatmapDataPoint) => void;
|
|
30
31
|
onHover?: (data: HeatmapDataPoint, event: React.MouseEvent) => void;
|
|
@@ -33,93 +34,59 @@ export interface HeatmapCellProps {
|
|
|
33
34
|
children?: ReactNode;
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Heatmap layout configuration
|
|
48
|
-
*/
|
|
49
|
-
export interface HeatmapLayout {
|
|
50
|
-
/** Gap between cells */
|
|
51
|
-
gap?: number | string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Heatmap axis configuration
|
|
37
|
+
* 🔴 `Pick` of StandardChartDisplayProps, never `extends` — see the rule on
|
|
38
|
+
* StandardVisualProps in chart.types.ts. `showGrid`/`theme` are meaningless
|
|
39
|
+
* here and `variant` is narrowed below, so none of the three are picked.
|
|
40
|
+
*
|
|
41
|
+
* `enableKeyboardNavigation` is omitted from BaseChartProps: the grid has no
|
|
42
|
+
* arrow-key roving navigation, so advertising the prop would promise behaviour
|
|
43
|
+
* the component doesn't have — exactly the failure mode that rule describes.
|
|
44
|
+
* (Individual cells remain Enter/Space activatable via native `tabIndex`/
|
|
45
|
+
* `onKeyDown` when `onCellClick` is set — that part is unrelated to this prop,
|
|
46
|
+
* which is specifically about grid-level arrow-key navigation.)
|
|
55
47
|
*/
|
|
56
|
-
export interface
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
export interface HeatmapProps extends Omit<BaseChartProps, 'data' | 'config' | 'enableKeyboardNavigation'>, Pick<StandardChartDisplayProps, 'showXAxis' | 'showYAxis' | 'minValue' | 'maxValue'> {
|
|
49
|
+
/**
|
|
50
|
+
* Colour-ramp legend position. Same union as every other chart, but redeclared
|
|
51
|
+
* rather than picked so it carries Heatmap's own documentation: this legend is
|
|
52
|
+
* a continuous ramp (see HeatmapLegend), not the series swatches `config`
|
|
53
|
+
* drives elsewhere, and it defaults to `'bottom'` rather than resolving to
|
|
54
|
+
* `'none'` for a single-series config — the ramp IS a heatmap's value key.
|
|
55
|
+
* @default 'bottom'
|
|
56
|
+
*/
|
|
57
|
+
legend?: ChartLegendPosition;
|
|
58
|
+
/** Heatmap data array — optional when using ChartContainer context */
|
|
59
|
+
data?: HeatmapDataPoint[];
|
|
60
|
+
/** Chart configuration — optional when using ChartContainer context */
|
|
61
|
+
config?: ChartConfig;
|
|
62
|
+
/** Semantic colour for heatmap cells @default 'primary' */
|
|
63
|
+
color?: SemanticColor;
|
|
64
|
+
/** Visual variant @default 'default' */
|
|
65
|
+
variant?: HeatmapVariant;
|
|
61
66
|
/** X-axis label formatter */
|
|
62
67
|
xAxisFormatter?: (value: string | number, index: number) => string;
|
|
63
68
|
/** Y-axis label formatter */
|
|
64
69
|
yAxisFormatter?: (value: string | number, index: number) => string;
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Heatmap tooltip configuration
|
|
72
|
-
*/
|
|
73
|
-
export interface HeatmapTooltipConfig {
|
|
74
|
-
/** Show tooltip on hover */
|
|
75
|
-
enabled?: boolean;
|
|
76
|
-
/** Custom tooltip formatter */
|
|
77
|
-
formatter?: (data: HeatmapDataPoint) => ReactNode;
|
|
78
|
-
/** Tooltip delay in ms */
|
|
79
|
-
delay?: number;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Heatmap legend configuration
|
|
83
|
-
*/
|
|
84
|
-
export interface HeatmapLegendConfig {
|
|
85
|
-
/** Show legend */
|
|
86
|
-
enabled?: boolean;
|
|
87
|
-
/** Custom labels for min and max values */
|
|
88
|
-
labels?: {
|
|
70
|
+
/**
|
|
71
|
+
* Captions at each end of the colour ramp.
|
|
72
|
+
* @default { min: 'Low activity', max: 'High activity' }
|
|
73
|
+
*/
|
|
74
|
+
legendLabels?: {
|
|
89
75
|
min?: string;
|
|
90
76
|
max?: string;
|
|
91
77
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
export interface HeatmapProps extends Omit<BaseChartProps, 'data' | 'config' | 'variant' | 'theme'> {
|
|
97
|
-
/** Heatmap data array - optional when using ChartContainer context */
|
|
98
|
-
data?: HeatmapDataPoint[];
|
|
99
|
-
/** Chart configuration - optional when using ChartContainer context */
|
|
100
|
-
config?: ChartConfig;
|
|
101
|
-
/** Semantic color for heatmap cells (primary, success, warning, danger) */
|
|
102
|
-
color?: SemanticColor;
|
|
103
|
-
/** Color scale configuration */
|
|
104
|
-
colorScale?: HeatmapColorScale;
|
|
105
|
-
/** Layout configuration */
|
|
106
|
-
layout?: HeatmapLayout;
|
|
107
|
-
/** Axis configuration */
|
|
108
|
-
axis?: HeatmapAxisConfig;
|
|
109
|
-
/** Tooltip configuration */
|
|
110
|
-
tooltip?: HeatmapTooltipConfig;
|
|
111
|
-
/** Legend configuration */
|
|
112
|
-
legend?: HeatmapLegendConfig;
|
|
113
|
-
/** Custom value range [min, max] - if not provided, will be calculated from data */
|
|
114
|
-
valueRange?: [number, number];
|
|
115
|
-
/** Cell click handler */
|
|
116
|
-
onCellClick?: (data: HeatmapDataPoint) => void;
|
|
78
|
+
/** Gap between cells @default 6 */
|
|
79
|
+
cellGap?: number | string;
|
|
80
|
+
/** Opacity floor for zero/lowest-intensity cells @default 0.1 */
|
|
81
|
+
minOpacity?: number;
|
|
117
82
|
/** Custom cell renderer */
|
|
118
83
|
cellRenderer?: (props: HeatmapCellProps) => ReactNode;
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
|
|
84
|
+
/** Cell click handler */
|
|
85
|
+
onCellClick?: (data: HeatmapDataPoint) => void;
|
|
86
|
+
/** Show the hover tooltip @default true */
|
|
87
|
+
showTooltip?: boolean;
|
|
88
|
+
/** Custom tooltip content */
|
|
89
|
+
tooltipFormatter?: (data: HeatmapDataPoint) => ReactNode;
|
|
123
90
|
}
|
|
124
91
|
/**
|
|
125
92
|
* Processed heatmap data with calculated values
|
|
@@ -1,95 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import React__default
|
|
4
|
-
import { motion } from 'motion/react';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { useReducedMotion, motion } from 'motion/react';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
import { heatmapTheme } from './Heatmap.theme.js';
|
|
7
|
+
import { HEATMAP_CELL_TAP_TRANSITION, HEATMAP_CELL_HOVER_TRANSITION, HEATMAP_CELL_FADE_DURATION } from '../utils/animation-utils.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* Individual heatmap cell
|
|
10
|
+
* Individual heatmap cell — colour intensity plus a deterministic fade-in.
|
|
11
|
+
*
|
|
12
|
+
* The resting opacity is the animation target (not an inline style), so motion
|
|
13
|
+
* owns it end to end; `data-intensity-opacity` publishes the resolved value for
|
|
14
|
+
* consumers and tests.
|
|
10
15
|
*/
|
|
11
|
-
const HeatmapCellInner = ({ data, intensity, minOpacity = 0.1, color = 'var(--color-primary)',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
backgroundColor: color,
|
|
33
|
-
opacity: baseOpacity
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
const getColorClass = (intensity) => {
|
|
37
|
-
// Only use gray colors for null values (missing data)
|
|
38
|
-
if (data.value === null) {
|
|
39
|
-
return 'bg-transparent border border-gray-200/80';
|
|
40
|
-
}
|
|
41
|
-
// For non-null values, we'll use inline styles
|
|
42
|
-
return '';
|
|
43
|
-
};
|
|
44
|
-
const handleClick = () => {
|
|
45
|
-
if (onClick) {
|
|
46
|
-
onClick(data);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const handleMouseEnter = (event) => {
|
|
50
|
-
if (onHover) {
|
|
51
|
-
onHover(data, event);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const handleMouseMove = (event) => {
|
|
55
|
-
if (onMouseMove) {
|
|
56
|
-
onMouseMove(data, event);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const handleMouseLeave = () => {
|
|
60
|
-
if (onLeave) {
|
|
61
|
-
onLeave();
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const handleAnimationEnd = () => {
|
|
65
|
-
// Remove animation class after flicker completes to prevent interference with opacity
|
|
66
|
-
if (containerRef.current) {
|
|
67
|
-
containerRef.current.classList.remove('animate-[flicker_0.6s_ease-out_forwards]');
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const containerRef = useRef(null);
|
|
71
|
-
const flickerDelayRef = useRef(`${Math.random() * 0.3}s`);
|
|
72
|
-
return (jsx(motion.div, { ref: containerRef, className: cn(heatmapTheme.cellBaseStyle, getColorClass(), onClick && 'cursor-pointer', className), style: {
|
|
73
|
-
...getColorStyle(intensity),
|
|
74
|
-
// CSS custom properties for the animation
|
|
75
|
-
'--flicker-delay': flickerDelayRef.current,
|
|
76
|
-
animationDelay: `var(--flicker-delay)`,
|
|
77
|
-
}, onAnimationEnd: handleAnimationEnd, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave,
|
|
78
|
-
// Framer Motion animations (just for hover/tap, not initial load)
|
|
79
|
-
whileHover: {
|
|
80
|
-
scale: 1.025,
|
|
81
|
-
transition: { duration: 0.15, ease: 'easeOut' }
|
|
82
|
-
}, whileTap: {
|
|
83
|
-
scale: 0.95,
|
|
84
|
-
transition: { duration: 0.1, ease: 'easeOut' }
|
|
85
|
-
},
|
|
86
|
-
// Accessibility
|
|
87
|
-
role: "gridcell", tabIndex: onClick ? 0 : -1, "aria-label": `Value: ${data.value}, X: ${data.x}, Y: ${data.y}`, onKeyDown: (e) => {
|
|
16
|
+
const HeatmapCellInner = ({ data, intensity, minOpacity = 0.1, color = 'var(--color-primary)', delay = 0, className, onClick, onHover, onMouseMove, onLeave, children, }) => {
|
|
17
|
+
const shouldReduceMotion = useReducedMotion();
|
|
18
|
+
const isNull = data.value === null;
|
|
19
|
+
// Map intensity (0-1) onto [minOpacity, 1] in 10% steps; a 0 value pins to
|
|
20
|
+
// minOpacity so an empty cell still reads as "measured, but nothing here".
|
|
21
|
+
const resolvedOpacity = isNull
|
|
22
|
+
? 0
|
|
23
|
+
: data.value === 0
|
|
24
|
+
? minOpacity
|
|
25
|
+
: Math.max(minOpacity, Math.min(1, Math.ceil(intensity * 10) / 10));
|
|
26
|
+
const handleClick = () => onClick === null || onClick === void 0 ? void 0 : onClick(data);
|
|
27
|
+
const handleMouseEnter = (event) => onHover === null || onHover === void 0 ? void 0 : onHover(data, event);
|
|
28
|
+
const handleMouseMove = (event) => onMouseMove === null || onMouseMove === void 0 ? void 0 : onMouseMove(data, event);
|
|
29
|
+
const handleMouseLeave = () => onLeave === null || onLeave === void 0 ? void 0 : onLeave();
|
|
30
|
+
return (jsx(motion.div, { "data-heatmap-cell": "", "data-intensity-opacity": resolvedOpacity, className: cn(heatmapTheme.cellBaseStyle, isNull && heatmapTheme.cellNullStyle, onClick && 'cursor-pointer', className), style: isNull ? undefined : { backgroundColor: color }, initial: shouldReduceMotion ? false : { opacity: 0 }, animate: { opacity: resolvedOpacity }, transition: shouldReduceMotion
|
|
31
|
+
? { duration: 0 }
|
|
32
|
+
: { duration: HEATMAP_CELL_FADE_DURATION, delay, ease: 'easeOut' }, onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, whileHover: shouldReduceMotion
|
|
33
|
+
? undefined
|
|
34
|
+
: { scale: 1.025, transition: HEATMAP_CELL_HOVER_TRANSITION }, whileTap: shouldReduceMotion
|
|
35
|
+
? undefined
|
|
36
|
+
: { scale: 0.95, transition: HEATMAP_CELL_TAP_TRANSITION }, role: "gridcell", tabIndex: onClick ? 0 : -1, "aria-label": `Value: ${data.value}, X: ${data.x}, Y: ${data.y}`, onKeyDown: (e) => {
|
|
88
37
|
if ((e.key === 'Enter' || e.key === ' ') && onClick) {
|
|
89
38
|
e.preventDefault();
|
|
90
39
|
onClick(data);
|
|
91
40
|
}
|
|
92
|
-
}, children: children && (jsx("div", { className:
|
|
41
|
+
}, children: children && (jsx("div", { className: heatmapTheme.cellOverlayStyle, children: children })) }));
|
|
93
42
|
};
|
|
94
43
|
const HeatmapCell = React__default.memo(HeatmapCellInner);
|
|
95
44
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The ramp is a purely visual scale: it renders the two end captions, never the
|
|
4
|
+
* numeric bounds. `minValue`/`maxValue` used to sit here and were never read —
|
|
5
|
+
* the same advertise-a-prop-you-ignore trap the flat-API refactor removed from
|
|
6
|
+
* `HeatmapProps`. If the numbers are ever wanted beside the ramp, that is a
|
|
7
|
+
* deliberate feature with its own rendering, not two dormant props.
|
|
8
|
+
*/
|
|
2
9
|
export interface HeatmapLegendProps {
|
|
3
|
-
/** Base color key from chart config (e.g., 'value', 'activity') */
|
|
4
|
-
colorKey?: string;
|
|
5
10
|
/** Color to use for the gradient */
|
|
6
11
|
color?: string;
|
|
7
|
-
/** Minimum value for the legend */
|
|
8
|
-
minValue?: number;
|
|
9
|
-
/** Maximum value for the legend */
|
|
10
|
-
maxValue?: number;
|
|
11
12
|
/** Custom labels for min and max */
|
|
12
13
|
labels?: {
|
|
13
14
|
min?: string;
|
|
@@ -2,16 +2,16 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { cn } from '../../../utils/cn.js';
|
|
3
3
|
import { heatmapTheme } from './Heatmap.theme.js';
|
|
4
4
|
|
|
5
|
-
const HeatmapLegend = ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const HeatmapLegend = ({ color = 'var(--color-primary)', // Correct CSS variable
|
|
6
|
+
labels, className }) => {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const min = (_a = labels === null || labels === void 0 ? void 0 : labels.min) !== null && _a !== void 0 ? _a : 'Low activity';
|
|
9
|
+
const max = (_b = labels === null || labels === void 0 ? void 0 : labels.max) !== null && _b !== void 0 ? _b : 'High activity';
|
|
10
10
|
// Create gradient using passed color (supports CSS variables and hex)
|
|
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-xs font-medium text-[var(--color-text-secondary)]", children: [jsx("div", { children: min }), jsx("div", { children: max })] })] }));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export { HeatmapLegend };
|
|
@@ -2,6 +2,6 @@ export { Heatmap } from './Heatmap';
|
|
|
2
2
|
export { HeatmapCell } from './HeatmapCell';
|
|
3
3
|
export { HeatmapLegend } from './HeatmapLegend';
|
|
4
4
|
export { heatmapTheme } from './Heatmap.theme';
|
|
5
|
-
export type { HeatmapProps, HeatmapDataPoint, HeatmapCellProps,
|
|
5
|
+
export type { HeatmapProps, HeatmapDataPoint, HeatmapCellProps, HeatmapVariant } from './Heatmap.types';
|
|
6
6
|
export * from './Heatmap.types';
|
|
7
7
|
export * from './utils/heatmapUtils';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { HeatmapDataPoint, ProcessedHeatmapData } from '../Heatmap.types';
|
|
2
2
|
/**
|
|
3
|
-
* Process raw heatmap data and calculate necessary values
|
|
3
|
+
* Process raw heatmap data and calculate necessary values.
|
|
4
|
+
* `minValue`/`maxValue` are the flat family-standard bounds; either may be
|
|
5
|
+
* omitted, in which case it is derived from the data.
|
|
4
6
|
*/
|
|
5
|
-
export declare function processHeatmapData(data: HeatmapDataPoint[],
|
|
7
|
+
export declare function processHeatmapData(data: HeatmapDataPoint[], minValue?: number, maxValue?: number): ProcessedHeatmapData;
|
|
6
8
|
/**
|
|
7
9
|
* Calculate intensity (0-1) for a given value within the range
|
|
8
10
|
*/
|
|
@@ -13,18 +15,11 @@ export declare function calculateIntensity(value: number | null, minValue: numbe
|
|
|
13
15
|
*/
|
|
14
16
|
export declare function createGridMatrix(data: HeatmapDataPoint[], xCategories: (string | number)[], yCategories: (string | number)[]): HeatmapDataPoint[][];
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
18
|
+
* Default tooltip content for a data point. `label` is the series label from
|
|
19
|
+
* `config[key].label` — the family contract every other chart already honours.
|
|
17
20
|
*/
|
|
18
|
-
export declare function getDefaultTooltipContent(data: HeatmapDataPoint): string;
|
|
21
|
+
export declare function getDefaultTooltipContent(data: HeatmapDataPoint, label?: string): string;
|
|
19
22
|
/**
|
|
20
23
|
* Format axis labels with common patterns
|
|
21
24
|
*/
|
|
22
25
|
export declare function formatAxisLabel(value: string | number, type?: 'day' | 'month' | 'hour' | 'date' | 'number' | 'default'): string;
|
|
23
|
-
/**
|
|
24
|
-
* Calculate responsive cell size based on container dimensions
|
|
25
|
-
*/
|
|
26
|
-
export declare function calculateCellSize(containerWidth: number, containerHeight: number, xCount: number, yCount: number, gap?: number, minSize?: number, maxSize?: number): number;
|
|
27
|
-
/**
|
|
28
|
-
* Generate sample heatmap data for testing/examples
|
|
29
|
-
*/
|
|
30
|
-
export declare function generateSampleData(type?: 'weekly' | 'monthly' | 'hourly'): HeatmapDataPoint[];
|