@flikk/ui 1.0.0-beta.31 → 1.0.0-beta.33
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 +497 -22
- 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/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.theme.js +2 -2
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.js +27 -3
- 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 +58 -5
- 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 +2 -1
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- 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 +13 -7
- 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.theme.js +1 -1
- package/dist/components/ai/index.d.ts +3 -2
- package/dist/components/ai/index.js +4 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +0 -1
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +0 -1
- package/dist/components/canvas/NodeRenderer.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +3 -3
- package/dist/components/charts/AreaChart/AreaChart.theme.js +3 -3
- package/dist/components/charts/BarChart/BarChart.js +4 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +2 -2
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +1 -1
- 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.js +1 -1
- package/dist/components/charts/LineChart/LineChart.js +2 -2
- package/dist/components/charts/LollipopChart/LollipopChart.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +3 -3
- package/dist/components/charts/hooks/useChartAccessibility.js +9 -6
- package/dist/components/charts/index.d.ts +4 -8
- package/dist/components/charts/index.js +2 -4
- 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 +3 -3
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -19
- package/dist/components/core/Accordion/Accordion.theme.js +1 -1
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -4
- package/dist/components/core/Alert/Alert.animations.js +11 -4
- package/dist/components/core/Alert/Alert.js +16 -2
- 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.theme.js +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -84
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +27 -64
- package/dist/components/core/Badge/Badge.theme.js +8 -12
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +4 -4
- package/dist/components/core/Button/Button.js +7 -43
- package/dist/components/core/Button/Button.theme.js +5 -5
- package/dist/components/core/Button/Button.types.d.ts +8 -12
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- 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 +29 -1
- 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/CardHeader.js +4 -1
- 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/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 +21 -8
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +1 -1
- package/dist/components/core/Drawer/DrawerHeader.js +0 -1
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Link/Link.js +1 -1
- 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 +2 -0
- package/dist/components/core/Message/Message.theme.js +3 -3
- 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.js +5 -1
- package/dist/components/core/Modal/Modal.theme.js +1 -1
- package/dist/components/core/Modal/ModalHeader.js +0 -1
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -1
- package/dist/components/core/NavItem/NavItem.js +3 -2
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +4 -2
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.js +34 -18
- package/dist/components/core/Pill/Pill.theme.js +4 -2
- package/dist/components/core/Pill/Pill.types.d.ts +14 -1
- 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.theme.js +1 -1
- 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 +3 -3
- 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/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +1 -1
- package/dist/components/core/Sidebar/SidebarSearch.js +2 -2
- package/dist/components/core/Sidebar/SidebarToggle.js +1 -1
- package/dist/components/core/Sidebar/SidebarUserProfile.js +1 -1
- package/dist/components/core/SlidingNumber/SlidingNumber.d.ts +8 -0
- package/dist/components/core/SlidingNumber/SlidingNumber.js +12 -3
- 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.theme.js +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- 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/data-display/GanttChart/GanttChart.theme.js +6 -6
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +0 -1
- package/dist/components/data-display/KPI/KPI.js +11 -20
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.theme.js +4 -4
- package/dist/components/data-display/Table/Table.theme.js +2 -2
- package/dist/components/data-display/Table/TableColumnManager.js +1 -2
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableFilter.js +9 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +1 -1
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- 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.theme.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.js +45 -3
- package/dist/components/forms/ColorPicker/ColorPickerBody.js +8 -4
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +1 -1
- package/dist/components/forms/Combobox/Combobox.js +10 -4
- package/dist/components/forms/Combobox/Combobox.theme.js +9 -0
- package/dist/components/forms/Combobox/Combobox.types.d.ts +13 -0
- package/dist/components/forms/DatePicker/DatePicker.js +19 -12
- package/dist/components/forms/DatePicker/DatePicker.theme.js +5 -0
- package/dist/components/forms/DatePicker/DatePicker.types.d.ts +8 -0
- package/dist/components/forms/DatePicker/DatePickerContext.d.ts +0 -1
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +5 -3
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +6 -1
- package/dist/components/forms/DateRangePicker/DateRangePicker.types.d.ts +8 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +5 -3
- package/dist/components/forms/FileUpload/FileUpload.theme.js +2 -2
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/Input/Input.js +17 -12
- package/dist/components/forms/Input/Input.theme.js +10 -0
- package/dist/components/forms/Input/Input.types.d.ts +14 -0
- package/dist/components/forms/InputAddress/InputAddress.js +5 -5
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +9 -2
- package/dist/components/forms/InputCounter/InputCounter.js +194 -17
- package/dist/components/forms/InputCounter/InputCounter.theme.d.ts +12 -0
- package/dist/components/forms/InputCounter/InputCounter.theme.js +92 -2
- package/dist/components/forms/InputCounter/InputCounter.types.d.ts +47 -4
- package/dist/components/forms/InputCreditCard/InputCreditCard.js +4 -4
- package/dist/components/forms/InputCreditCard/InputCreditCard.types.d.ts +7 -0
- package/dist/components/forms/Mention/Mention.js +13 -11
- package/dist/components/forms/Radio/Radio.theme.js +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +174 -1680
- 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.js +19 -12
- package/dist/components/forms/Select/Select.theme.js +9 -1
- package/dist/components/forms/Select/Select.types.d.ts +86 -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.js +2 -1
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Switch/Switch.theme.js +2 -2
- package/dist/components/forms/Textarea/Textarea.js +14 -25
- package/dist/components/forms/TimePicker/TimePicker.theme.js +10 -1
- package/dist/components/forms/TimePicker/TimePicker.types.d.ts +11 -0
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +7 -5
- package/dist/components/forms/forms.theme.d.ts +57 -0
- package/dist/components/forms/forms.theme.js +102 -13
- package/dist/components/forms/index.js +1 -0
- 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 +11 -10
- package/dist/components/generative/schema.generated.js +199 -293
- 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 +199 -293
- package/dist/index.js +1 -4
- package/dist/registry.json +2765 -2450
- package/dist/shadcn-compat.css +5 -5
- 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/themes/precision.css +232 -0
- package/dist/tools.json +200 -295
- package/dist/utils/composeEventHandlers.d.ts +19 -0
- package/dist/utils/composeEventHandlers.js +26 -0
- package/dist/utils/composeEventHandlers.test.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +31 -1
- package/src/global.scss +21 -28
- package/src/styles/theme.css +157 -50
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +30 -20
- 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 -208
- 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 -60
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -19
- 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/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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import React__default, { createContext, useRef, useMemo, useContext } from 'react';
|
|
4
4
|
import { motion } from 'motion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { getTokenFadeIn } from './StreamingResponse.animations.js';
|
|
6
6
|
import { StreamingCursor } from './StreamingCursor.js';
|
|
7
7
|
|
|
8
8
|
const WordAnimationContext = createContext(null);
|
|
@@ -32,7 +32,7 @@ const countWordsInChildren = (children) => {
|
|
|
32
32
|
});
|
|
33
33
|
return count;
|
|
34
34
|
};
|
|
35
|
-
const WordAnimationProvider = ({ children, content, enabled, animateLastN = 12, hasCursor = false, }) => {
|
|
35
|
+
const WordAnimationProvider = ({ children, content, enabled, animateLastN = 12, hasCursor = false, tokenEffect = "fade", tokenDuration = 0.12, }) => {
|
|
36
36
|
const settledCountRef = useRef(0);
|
|
37
37
|
// Count total prose words in the raw content
|
|
38
38
|
const totalWords = useMemo(() => {
|
|
@@ -48,6 +48,7 @@ const WordAnimationProvider = ({ children, content, enabled, animateLastN = 12,
|
|
|
48
48
|
const wordIndexRef = useRef(0);
|
|
49
49
|
wordIndexRef.current = 0;
|
|
50
50
|
const settledCount = settledCountRef.current;
|
|
51
|
+
const tokenVariants = useMemo(() => getTokenFadeIn(tokenEffect), [tokenEffect]);
|
|
51
52
|
const contextValue = useMemo(() => {
|
|
52
53
|
if (!enabled) {
|
|
53
54
|
return {
|
|
@@ -109,7 +110,7 @@ const WordAnimationProvider = ({ children, content, enabled, animateLastN = 12,
|
|
|
109
110
|
staticBuffer = "";
|
|
110
111
|
}
|
|
111
112
|
// Animated word
|
|
112
|
-
result.push(jsx(motion.span, { variants:
|
|
113
|
+
result.push(jsx(motion.span, { variants: tokenVariants, initial: "hidden", animate: "visible", transition: { duration: tokenDuration, ease: [0, 0, 0.2, 1] }, style: { display: "inline" }, children: token }, `word-${currentIndex}-${token.trim()}`));
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
// Flush any remaining static buffer
|
|
@@ -128,7 +129,7 @@ const WordAnimationProvider = ({ children, content, enabled, animateLastN = 12,
|
|
|
128
129
|
};
|
|
129
130
|
return { processChildren, skipChildren };
|
|
130
131
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
|
-
}, [enabled, settledCount, totalWords]);
|
|
132
|
+
}, [enabled, settledCount, tokenDuration, tokenVariants, totalWords]);
|
|
132
133
|
return (jsx(WordAnimationContext.Provider, { value: contextValue, children: children }));
|
|
133
134
|
};
|
|
134
135
|
WordAnimationProvider.displayName = "WordAnimationProvider";
|
|
@@ -7,11 +7,13 @@ export { ErrorDisplay } from './ErrorDisplay';
|
|
|
7
7
|
export { MarkdownRenderer } from './MarkdownRenderer';
|
|
8
8
|
export { AnimatedText } from './AnimatedText';
|
|
9
9
|
export { StreamingCursor } from './StreamingCursor';
|
|
10
|
+
export { StreamingSurface } from './StreamingSurface';
|
|
10
11
|
export { WordAnimationProvider, useWordAnimation } from './WordAnimationContext';
|
|
11
12
|
export { streamingResponseTheme } from './StreamingResponse.theme';
|
|
12
|
-
export { tokenFadeIn, tokenTransition, blockSlideIn, blockTransition, inlineTokenFadeIn, inlineTokenTransition, cursorPulse, staggerContainer, } from './StreamingResponse.animations';
|
|
13
|
-
export type { StreamingResponseProps, StreamingResponseTheme, MarkdownOptions, MessageAvatarProps, } from './StreamingResponse.types';
|
|
13
|
+
export { tokenFadeIn, tokenTransition, blockSlideIn, blockTransition, inlineTokenFadeIn, inlineTokenTransition, cursorPulse, staggerContainer, resolveStreamingMotion, getTokenFadeIn, type ResolvedStreamingMotion, } from './StreamingResponse.animations';
|
|
14
|
+
export type { StreamingResponseProps, StreamingResponseTheme, MarkdownOptions, MessageAvatarProps, StreamingMotionOptions, StreamingMotionPreset, StreamingTokenEffect, } from './StreamingResponse.types';
|
|
14
15
|
export type { AnimatedTextProps } from './AnimatedText';
|
|
15
16
|
export type { StreamingCursorProps } from './StreamingCursor';
|
|
17
|
+
export type { StreamingSurfaceProps } from './StreamingSurface';
|
|
16
18
|
export type { MarkdownRendererProps } from './MarkdownRenderer';
|
|
17
19
|
export type { WordAnimationProviderProps } from './WordAnimationContext';
|
|
@@ -5,7 +5,7 @@ const tokenCounterTheme = {
|
|
|
5
5
|
labelStyle: "text-[var(--color-text-muted)]",
|
|
6
6
|
costStyle: "text-[var(--color-text-muted)] font-mono",
|
|
7
7
|
progressStyle: "h-1 bg-[var(--color-surface-sunken)] rounded-full overflow-hidden shadow-inner-real-sm",
|
|
8
|
-
progressBarStyle: "h-full bg-[var(--color-primary)] transition-all duration-
|
|
8
|
+
progressBarStyle: "h-full bg-[var(--color-primary)] transition-all duration-[var(--motion-duration-base)]",
|
|
9
9
|
sizes: {
|
|
10
10
|
sm: {
|
|
11
11
|
container: "text-xs",
|
|
@@ -6,10 +6,11 @@ export { TokenCounter, tokenCounterTheme, estimateTokens, calculateCost, formatC
|
|
|
6
6
|
export type { TokenCounterProps, TokenCounterModel, TokenCounterSize, TokenCounterTheme, TokenCounterThemeOverrides, ModelConfig, } from "./TokenCounter";
|
|
7
7
|
export { PromptSuggestion, promptSuggestionTheme } from "./PromptSuggestion";
|
|
8
8
|
export type { PromptSuggestionProps, PromptSuggestionTheme, } from "./PromptSuggestion";
|
|
9
|
-
export { StreamingResponse, ErrorDisplay, MarkdownRenderer, AnimatedText, StreamingCursor, streamingResponseTheme, tokenFadeIn, tokenTransition, blockSlideIn, blockTransition, cursorPulse, staggerContainer, } from "./StreamingResponse";
|
|
10
|
-
export type { StreamingResponseProps, StreamingResponseTheme, MarkdownOptions, AnimatedTextProps, StreamingCursorProps, MarkdownRendererProps, } from "./StreamingResponse";
|
|
9
|
+
export { StreamingResponse, ErrorDisplay, MarkdownRenderer, AnimatedText, StreamingCursor, StreamingSurface, streamingResponseTheme, tokenFadeIn, tokenTransition, blockSlideIn, blockTransition, cursorPulse, staggerContainer, } from "./StreamingResponse";
|
|
10
|
+
export type { StreamingResponseProps, StreamingResponseTheme, MarkdownOptions, AnimatedTextProps, StreamingCursorProps, StreamingSurfaceProps, MarkdownRendererProps, StreamingMotionOptions, StreamingMotionPreset, StreamingTokenEffect, } from "./StreamingResponse";
|
|
11
11
|
export { CodeBlock, codeBlockTheme } from "./CodeBlock";
|
|
12
12
|
export type { CodeBlockProps, CodeBlockLanguage, CodeBlockTheme, CodeBlockThemeOverrides, } from "./CodeBlock";
|
|
13
13
|
export * from "./AgentStatus";
|
|
14
|
+
export * from "./AgentRequest";
|
|
14
15
|
export * from "./Reasoning";
|
|
15
16
|
export * from "./SourceCitation";
|
|
@@ -19,6 +19,7 @@ export { ErrorDisplay } from './StreamingResponse/ErrorDisplay.js';
|
|
|
19
19
|
export { MarkdownRenderer } from './StreamingResponse/MarkdownRenderer.js';
|
|
20
20
|
export { AnimatedText } from './StreamingResponse/AnimatedText.js';
|
|
21
21
|
export { StreamingCursor } from './StreamingResponse/StreamingCursor.js';
|
|
22
|
+
export { StreamingSurface } from './StreamingResponse/StreamingSurface.js';
|
|
22
23
|
import './StreamingResponse/WordAnimationContext.js';
|
|
23
24
|
export { streamingResponseTheme } from './StreamingResponse/StreamingResponse.theme.js';
|
|
24
25
|
export { blockSlideIn, blockTransition, cursorPulse, staggerContainer, tokenFadeIn, tokenTransition } from './StreamingResponse/StreamingResponse.animations.js';
|
|
@@ -26,6 +27,9 @@ export { CodeBlock } from './CodeBlock/CodeBlock.js';
|
|
|
26
27
|
export { codeBlockTheme } from './CodeBlock/CodeBlock.theme.js';
|
|
27
28
|
export { AgentStatus } from './AgentStatus/AgentStatus.js';
|
|
28
29
|
export { agentStatusTheme } from './AgentStatus/AgentStatus.theme.js';
|
|
30
|
+
export { AgentRequest } from './AgentRequest/AgentRequest.js';
|
|
31
|
+
export { agentRequestTheme } from './AgentRequest/AgentRequest.theme.js';
|
|
29
32
|
export { Reasoning } from './Reasoning/Reasoning.js';
|
|
33
|
+
export { reasoningTheme } from './Reasoning/Reasoning.theme.js';
|
|
30
34
|
export { SourceCitation, SourceCitationGroup } from './SourceCitation/SourceCitation.js';
|
|
31
35
|
export { sourceCitationTheme } from './SourceCitation/SourceCitation.theme.js';
|
|
@@ -11,7 +11,7 @@ import { cn } from '../../utils/cn.js';
|
|
|
11
11
|
* `<button>`/`<input>`) to keep them clickable without starting a drag.
|
|
12
12
|
*/
|
|
13
13
|
const BaseNode = React__default.forwardRef(function BaseNode({ selected, className, children, ...rest }, ref) {
|
|
14
|
-
return (jsx("div", { ref: ref, className: cn("relative min-w-[8rem] rounded-[var(--canvas-node-radius,0.75rem)] border bg-[var(--color-surface)] shadow-sm", "transition-all duration-
|
|
14
|
+
return (jsx("div", { ref: ref, className: cn("relative min-w-[8rem] rounded-[var(--canvas-node-radius,0.75rem)] border bg-[var(--color-surface)] shadow-sm", "transition-all duration-[var(--motion-duration-slow)]", selected
|
|
15
15
|
? "border-[var(--color-surface)] ring-4 ring-[var(--color-primary)]"
|
|
16
16
|
: "border-[var(--color-border)] group-hover:border-[var(--color-border-hover)] group-hover:shadow-real-md", className), ...rest, children: children }));
|
|
17
17
|
});
|
|
@@ -3,7 +3,6 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { CursorClick, Hand, Plus } from '@phosphor-icons/react';
|
|
4
4
|
import { cn } from '../../utils/cn.js';
|
|
5
5
|
import { Button } from '../core/Button/Button.js';
|
|
6
|
-
import 'react';
|
|
7
6
|
import { Dropdown } from '../core/Dropdown/Dropdown.js';
|
|
8
7
|
import '../core/Dropdown/DropdownTrigger.js';
|
|
9
8
|
import '../core/Dropdown/DropdownMenu.js';
|
|
@@ -88,9 +88,9 @@ const Edge = React__default.memo(function Edge({ id, type = "bezier", source, so
|
|
|
88
88
|
const d = buildEdgePath(type, source, sourcePosition, target, targetPosition);
|
|
89
89
|
// Inline stroke beats the class strokes below; selection keeps priority.
|
|
90
90
|
const colorStyle = color && !selected ? { stroke: color } : undefined;
|
|
91
|
-
return (jsxs("g", { className: "group", children: [onPointerDown && (jsx("path", { d: d, fill: "none", stroke: "transparent", strokeWidth: 16, strokeLinecap: "round", "data-flikkui-edge": "", "data-edge-id": id, style: { pointerEvents: "stroke", cursor: "pointer" }, onPointerDown: onPointerDown })), jsx("path", { d: d, fill: "none", strokeWidth: selected ? 8 : 6, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", strokeDasharray: dashed ? "5 4" : undefined, style: colorStyle, className: cn("pointer-events-none opacity-0 transition-opacity duration-
|
|
91
|
+
return (jsxs("g", { className: "group", children: [onPointerDown && (jsx("path", { d: d, fill: "none", stroke: "transparent", strokeWidth: 16, strokeLinecap: "round", "data-flikkui-edge": "", "data-edge-id": id, style: { pointerEvents: "stroke", cursor: "pointer" }, onPointerDown: onPointerDown })), jsx("path", { d: d, fill: "none", strokeWidth: selected ? 8 : 6, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", strokeDasharray: dashed ? "5 4" : undefined, style: colorStyle, className: cn("pointer-events-none opacity-0 transition-opacity duration-[var(--motion-duration-fast)]", selected
|
|
92
92
|
? "opacity-20 stroke-[var(--color-primary)]"
|
|
93
|
-
: "stroke-[var(--color-primary)] group-hover:opacity-10") }), jsx("path", { d: d, fill: "none", strokeWidth: selected ? 2.5 : 1.5, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", strokeDasharray: dashed ? "5 4" : undefined, style: colorStyle, className: cn("transition-[stroke,stroke-width] duration-
|
|
93
|
+
: "stroke-[var(--color-primary)] group-hover:opacity-10") }), jsx("path", { d: d, fill: "none", strokeWidth: selected ? 2.5 : 1.5, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", strokeDasharray: dashed ? "5 4" : undefined, style: colorStyle, className: cn("transition-[stroke,stroke-width] duration-[var(--motion-duration-fast)]", selected
|
|
94
94
|
? "stroke-[var(--color-primary)]"
|
|
95
95
|
: "stroke-[var(--color-border)] group-hover:stroke-[var(--color-border-hover)]") })] }));
|
|
96
96
|
},
|
|
@@ -3,7 +3,6 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Plus, Minus, ArrowsOutSimple, Lock, LockOpen } from '@phosphor-icons/react';
|
|
4
4
|
import { cn } from '../../utils/cn.js';
|
|
5
5
|
import { Button } from '../core/Button/Button.js';
|
|
6
|
-
import 'react';
|
|
7
6
|
import { useCanvasApi } from './context/CanvasContext.js';
|
|
8
7
|
import { clamp } from './utils.js';
|
|
9
8
|
|
|
@@ -78,7 +78,7 @@ function AutoHandle({ nodeId, position }) {
|
|
|
78
78
|
unregister(nodeId, handleKey("source", handleId));
|
|
79
79
|
};
|
|
80
80
|
}, [nodeId, handleId, position, register, unregister, viewportRef]);
|
|
81
|
-
return (jsx("button", { ref: ref, type: "button", "data-flikkui-handle": "", "data-node-id": nodeId, "data-handle-type": "source", "data-handle-id": handleId, "data-handle-kind": "auto", "aria-label": `Connect from ${position}`, className: cn("nodrag absolute z-20 grid place-items-center size-4 rounded-full", "bg-[var(--color-primary)] text-[var(--color-primary-contrast)] shadow-md ring-2 ring-[var(--color-surface)] cursor-crosshair", "opacity-0 scale-75 pointer-events-none transition-[opacity,transform,box-shadow] duration-
|
|
81
|
+
return (jsx("button", { ref: ref, type: "button", "data-flikkui-handle": "", "data-node-id": nodeId, "data-handle-type": "source", "data-handle-id": handleId, "data-handle-kind": "auto", "aria-label": `Connect from ${position}`, className: cn("nodrag absolute z-20 grid place-items-center size-4 rounded-full", "bg-[var(--color-primary)] text-[var(--color-primary-contrast)] shadow-md ring-2 ring-[var(--color-surface)] cursor-crosshair", "opacity-0 scale-75 pointer-events-none transition-[opacity,transform,box-shadow] duration-[var(--motion-duration-fast)] ease-out", "hover:scale-110 hover:shadow-lg hover:ring-4 active:scale-95", !disabled &&
|
|
82
82
|
"group-hover:opacity-100 group-hover:scale-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:scale-100 group-focus-within:pointer-events-auto", AUTO_SIDE_CLASSES[position]), onPointerDown: disabled ? undefined : onPointerDown, children: jsx(Plus, { className: "size-2.5" }) }));
|
|
83
83
|
}
|
|
84
84
|
// Memoized so unrelated graph updates (another node's data/position, selection
|
|
@@ -110,7 +110,7 @@ const NodeWrapper = React__default.memo(function NodeWrapper({ node, NodeCompone
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
const selected = !!node.selected;
|
|
113
|
-
return (jsx("div", { className: cn("group absolute top-0 left-0 rounded-[var(--canvas-node-radius,0.75rem)]", "transition-[box-shadow,filter,opacity] duration-
|
|
113
|
+
return (jsx("div", { className: cn("group absolute top-0 left-0 rounded-[var(--canvas-node-radius,0.75rem)]", "transition-[box-shadow,filter,opacity] duration-[var(--motion-duration-fast)] ease-out", "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-background)]", tool === "pan"
|
|
114
114
|
? "cursor-grab"
|
|
115
115
|
: node.draggable !== false && "cursor-grab active:cursor-grabbing",
|
|
116
116
|
// Selection visuals belong to the node component (BaseNode is the
|
|
@@ -7,7 +7,7 @@ import { activityRingsTheme } from './ActivityRings.theme.js';
|
|
|
7
7
|
import { ACTIVITY_RINGS_DEFAULTS } from './ActivityRings.types.js';
|
|
8
8
|
import { Warning } from '@phosphor-icons/react';
|
|
9
9
|
import { useTooltipPosition } from '../hooks/useTooltipPosition.js';
|
|
10
|
-
import { ChartTooltip } from '
|
|
10
|
+
import { ChartTooltip } from '../../core/shared/ChartTooltip/ChartTooltip.js';
|
|
11
11
|
import { getSpringAnimation, CIRCULAR_CHART_ANIMATIONS, getStaggerDelay } from '../utils/animation-utils.js';
|
|
12
12
|
|
|
13
13
|
const RingElement = React__default.memo(({ ring, index, radius, center, svgSize, strokeWidth, ringColor, hasAnimated, showAnimation, shouldReduceMotion, animationDelay, handleMouseEnter, handleMouseMove, handleMouseLeave, }) => {
|
|
@@ -39,7 +39,7 @@ const RingElement = React__default.memo(({ ring, index, radius, center, svgSize,
|
|
|
39
39
|
}, [index, ring.label, ring.value, ringColor, center, radius, svgSize, handleMouseEnter]);
|
|
40
40
|
const onMouseMove = useCallback((e) => handleMouseMove(e), [handleMouseMove]);
|
|
41
41
|
const onMouseLeave = useCallback(() => handleMouseLeave(), [handleMouseLeave]);
|
|
42
|
-
return (jsxs("g", { children: [jsx("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: "var(--color-chart-track)", strokeWidth: strokeWidth, strokeLinecap: "round", className: "cursor-pointer", transform: `rotate(-90 ${center} ${center})`, onMouseEnter: onMouseEnter, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave }), jsx(motion.circle, { cx: center, cy: center, r: radius, fill: "none", stroke: ringColor, strokeWidth: strokeWidth, strokeLinecap: "round", strokeDasharray: circumference, className: "cursor-pointer transition-opacity duration-
|
|
42
|
+
return (jsxs("g", { children: [jsx("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: "var(--color-chart-track)", strokeWidth: strokeWidth, strokeLinecap: "round", className: "cursor-pointer", transform: `rotate(-90 ${center} ${center})`, onMouseEnter: onMouseEnter, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave }), jsx(motion.circle, { cx: center, cy: center, r: radius, fill: "none", stroke: ringColor, strokeWidth: strokeWidth, strokeLinecap: "round", strokeDasharray: circumference, className: "cursor-pointer transition-opacity duration-[var(--motion-duration-base)]", initial: { strokeDashoffset: circumference }, animate: hasAnimated ? { strokeDashoffset: offset } : {}, transition: showAnimation && !shouldReduceMotion
|
|
43
43
|
? getSpringAnimation(CIRCULAR_CHART_ANIMATIONS.activityRings.preset, shouldReduceMotion, animationDelay)
|
|
44
44
|
: { duration: 0 }, transform: `rotate(-90 ${center} ${center})`, onMouseEnter: onMouseEnter, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave })] }));
|
|
45
45
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Follows the established chart theming pattern with CSS variables
|
|
5
5
|
*/
|
|
6
6
|
const activityRingsTheme = {
|
|
7
|
-
baseStyle: "relative flex items-center justify-center transition-all duration-
|
|
7
|
+
baseStyle: "relative flex items-center justify-center transition-all duration-[var(--motion-duration-slow)] cursor-default",
|
|
8
8
|
svgStyle: "overflow-visible relative",
|
|
9
9
|
ringDefaults: {
|
|
10
10
|
strokeWidth: 8,
|
|
@@ -9,7 +9,7 @@ import { useChartDimensions } from '../hooks/useChartDimensions.js';
|
|
|
9
9
|
import { XAxis } from '../shared/ChartAxis/XAxis.js';
|
|
10
10
|
import { YAxis } from '../shared/ChartAxis/YAxis.js';
|
|
11
11
|
import { HorizontalGrid } from '../shared/ChartGrid/HorizontalGrid.js';
|
|
12
|
-
import { ChartTooltip } from '
|
|
12
|
+
import { ChartTooltip } from '../../core/shared/ChartTooltip/ChartTooltip.js';
|
|
13
13
|
import { resolveLegendPosition, ChartLegend } from '../shared/ChartLegend/ChartLegend.js';
|
|
14
14
|
import { ChartMarker } from '../shared/ChartMarker/ChartMarker.js';
|
|
15
15
|
import { ChartCrosshair } from '../shared/ChartCrosshair/ChartCrosshair.js';
|
|
@@ -279,14 +279,14 @@ svgClassName, areaClassName, lineClassName, gridClassName, axisClassName, width,
|
|
|
279
279
|
// so `originY:1` anchors scaleY to the group's fill-box BOTTOM.
|
|
280
280
|
// The invisible rect below pins that bottom to the plot baseline,
|
|
281
281
|
// so the series grows UP from the x-axis — not from its own mid-height.
|
|
282
|
-
style: RISE_FROM_BASELINE, children: [jsx("rect", { x: margin.left, y: margin.top, width: innerWidth, height: innerHeight, fill: "none", stroke: "none", style: { pointerEvents: "none" } }), jsx("path", { d: paths.areaPath, fill: `url(#${getAreaGradientId(keyIndex)})`, className: "transition-colors duration-
|
|
282
|
+
style: RISE_FROM_BASELINE, children: [jsx("rect", { x: margin.left, y: margin.top, width: innerWidth, height: innerHeight, fill: "none", stroke: "none", style: { pointerEvents: "none" } }), jsx("path", { d: paths.areaPath, fill: `url(#${getAreaGradientId(keyIndex)})`, className: "transition-colors duration-[var(--motion-duration-base)]", filter: isGradientVariant ? undefined : `url(#${shadowFilterId})`, transform: isGradientVariant
|
|
283
283
|
? `translate(0 ${gradientAreaGap})`
|
|
284
284
|
: undefined }), showStroke && (jsxs(Fragment, { children: [isGradientVariant && (jsx(motion.path, { d: paths.linePath, initial: { opacity: 1 }, animate: { opacity: 1 }, fill: "none", stroke: resolveSeriesColor(keyIndex, key, config, chartTheme.baseStyle.colors.series), strokeWidth: gradientStrokeWidth + 1, strokeLinecap: "round", strokeLinejoin: "round",
|
|
285
285
|
// Stroke width must ignore the group's scaleY rise, else
|
|
286
286
|
// it squashes flat at the start of the animation.
|
|
287
287
|
vectorEffect: "non-scaling-stroke", opacity: 0.08, filter: `url(#${getLineGlowId(keyIndex)})`, style: { pointerEvents: "none" } })), jsx(motion.path, { d: paths.linePath, initial: { opacity: 1 }, animate: { opacity: 1 }, fill: "none", stroke: ((_a = config[key]) === null || _a === void 0 ? void 0 : _a.color) ? resolveSeriesColor(keyIndex, key, config, []) : (isGradientVariant ? resolveSeriesColor(keyIndex, undefined, undefined, chartTheme.baseStyle.colors.series) : undefined), strokeWidth: isGradientVariant ? gradientStrokeWidth : strokeWidth, strokeLinecap: "round", strokeLinejoin: "round",
|
|
288
288
|
// Constant stroke width through the scaleY rise (no squash).
|
|
289
|
-
vectorEffect: "non-scaling-stroke", className: cn("transition-colors duration-
|
|
289
|
+
vectorEffect: "non-scaling-stroke", className: cn("transition-colors duration-[var(--motion-duration-base)]", !isGradientVariant &&
|
|
290
290
|
(colorClass
|
|
291
291
|
.split(" ")
|
|
292
292
|
.find((cls) => cls.startsWith("stroke-")) || ""), lineClassName), style: { stroke: ((_b = config[key]) === null || _b === void 0 ? void 0 : _b.color) ? resolveSeriesColor(keyIndex, key, config, []) : undefined } })] }))] }, `${key}${shouldReduceMotion ? "" : `-${dataSignature}`}`));
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
const areaChartTheme = {
|
|
9
9
|
// Main container with transition utilities for hover states
|
|
10
|
-
containerStyle: "chart-container w-full h-full relative [&_.chart-areas]:transition-opacity [&_.chart-areas]:duration-
|
|
10
|
+
containerStyle: "chart-container w-full h-full relative [&_.chart-areas]:transition-opacity [&_.chart-areas]:duration-[var(--motion-duration-slow)] [&_.chart-hover-areas]:cursor-pointer [&_.chart-hover-markers]:transition-all [&_.chart-hover-markers]:duration-[var(--motion-duration-base)]",
|
|
11
11
|
// SVG container with overflow and transition utilities
|
|
12
|
-
svgStyle: "overflow-visible [&_.chart-areas_path]:transition-all [&_.chart-areas_path]:duration-
|
|
12
|
+
svgStyle: "overflow-visible [&_.chart-areas_path]:transition-all [&_.chart-areas_path]:duration-[var(--motion-duration-base)]",
|
|
13
13
|
// Area group styling with drop shadows
|
|
14
|
-
areaGroupStyle: "chart-areas [&_path]:drop-shadow-sm [&_path]:transition-all [&_path]:duration-
|
|
14
|
+
areaGroupStyle: "chart-areas [&_path]:drop-shadow-sm [&_path]:transition-all [&_path]:duration-[var(--motion-duration-base)]",
|
|
15
15
|
// Empty state text color using correct CSS variable
|
|
16
16
|
emptyStateStyle: "chart-container flex items-center justify-center text-[var(--color-text-placeholder)]",
|
|
17
17
|
};
|
|
@@ -11,7 +11,7 @@ import { ChartErrorBoundary } from '../shared/ChartErrorBoundary/ChartErrorBound
|
|
|
11
11
|
import { XAxis } from '../shared/ChartAxis/XAxis.js';
|
|
12
12
|
import { YAxis } from '../shared/ChartAxis/YAxis.js';
|
|
13
13
|
import { HorizontalGrid } from '../shared/ChartGrid/HorizontalGrid.js';
|
|
14
|
-
import { ChartTooltip } from '
|
|
14
|
+
import { ChartTooltip } from '../../core/shared/ChartTooltip/ChartTooltip.js';
|
|
15
15
|
import { resolveLegendPosition, ChartLegend } from '../shared/ChartLegend/ChartLegend.js';
|
|
16
16
|
import { BAR_CHART_DEFAULTS } from './BarChart.types.js';
|
|
17
17
|
import { X_AXIS_MARGIN } from '../types/chart.types.js';
|
|
@@ -313,7 +313,7 @@ className, title, description, enableKeyboardNavigation = BAR_CHART_DEFAULTS.ena
|
|
|
313
313
|
: { scaleY: 1, opacity: 1 }, animate: {
|
|
314
314
|
scaleY: 1,
|
|
315
315
|
opacity: 1,
|
|
316
|
-
}, transition: { ...BAR_SPRING, delay }, className: "transition-opacity duration-
|
|
316
|
+
}, transition: { ...BAR_SPRING, delay }, className: "transition-opacity duration-[var(--motion-duration-base)]", style: {
|
|
317
317
|
originY: 1,
|
|
318
318
|
transformOrigin: "bottom",
|
|
319
319
|
fill: `url(#${hatchPatternId})`,
|
|
@@ -345,8 +345,8 @@ className, title, description, enableKeyboardNavigation = BAR_CHART_DEFAULTS.ena
|
|
|
345
345
|
// plain style values at mount and ignores re-render changes
|
|
346
346
|
opacity: barDimOpacity(shouldReduceOpacity, isGradientVariant),
|
|
347
347
|
}, transition: commonTransition, className: cn(isGradientVariant
|
|
348
|
-
? "transition-all duration-
|
|
349
|
-
: "transition-colors duration-
|
|
348
|
+
? "transition-all duration-[var(--motion-duration-slow)] ease-out"
|
|
349
|
+
: "transition-colors duration-[var(--motion-duration-base)]", !isNull && "cursor-pointer", isFocused && "stroke-2"), style: {
|
|
350
350
|
originY: isNegative ? 0 : 1,
|
|
351
351
|
transformOrigin: isNegative ? "top" : "bottom",
|
|
352
352
|
fill: barFill({
|
|
@@ -163,8 +163,8 @@ const BarRenderer = ({ data, config, scales, dimensions, margin, stacked = false
|
|
|
163
163
|
}, transition: isStacked
|
|
164
164
|
? stackedSegmentTransition(delay, hasAnimated)
|
|
165
165
|
: barEntranceTransition(delay, hasAnimated), className: cn(isGradientVariant
|
|
166
|
-
? "transition-all duration-
|
|
167
|
-
: "transition-colors duration-
|
|
166
|
+
? "transition-all duration-[var(--motion-duration-slow)] ease-out"
|
|
167
|
+
: "transition-colors duration-[var(--motion-duration-base)]", !isNull && "cursor-pointer", isFocused && "stroke-2"), style: {
|
|
168
168
|
originY: isNegative ? 0 : 1,
|
|
169
169
|
transformOrigin: isNegative ? "top" : "bottom",
|
|
170
170
|
fill: barFill({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChartDataPoint, ChartConfig } from '../types/chart.types';
|
|
2
2
|
import type { ChartScales } from '../hooks/useChartScales';
|
|
3
3
|
import type { ChartDimensions, ChartMargins } from './ComboChartCanvas.types';
|
|
4
|
-
import type { MultiSeriesData } from '
|
|
4
|
+
import type { MultiSeriesData } from '../../core/shared/ChartTooltip';
|
|
5
5
|
export interface BarRendererProps {
|
|
6
6
|
/**
|
|
7
7
|
* Chart data
|
|
@@ -9,7 +9,7 @@ import { ChartErrorBoundary } from '../shared/ChartErrorBoundary/ChartErrorBound
|
|
|
9
9
|
import { XAxis } from '../shared/ChartAxis/XAxis.js';
|
|
10
10
|
import { YAxis } from '../shared/ChartAxis/YAxis.js';
|
|
11
11
|
import { HorizontalGrid } from '../shared/ChartGrid/HorizontalGrid.js';
|
|
12
|
-
import { ChartTooltip } from '
|
|
12
|
+
import { ChartTooltip } from '../../core/shared/ChartTooltip/ChartTooltip.js';
|
|
13
13
|
|
|
14
14
|
const ComboChartContext = createContext(null);
|
|
15
15
|
/**
|
|
@@ -106,7 +106,7 @@ const LineRenderer = ({ data, config, scales, dimensions, margin, strokeWidth =
|
|
|
106
106
|
const appliedColorClass = customColor ? undefined : fallbackClass;
|
|
107
107
|
return (jsxs("g", { children: [jsxs(motion.g, { initial: { scaleY: shouldReduceMotion ? 1 : 0 }, animate: { scaleY: 1 }, transition: riseTransition, style: RISE_FROM_BASELINE, children: [jsx("rect", { x: margin.left, y: margin.top, width: innerWidth, height: innerHeight, fill: "none", stroke: "none", style: { pointerEvents: "none" } }), jsx("path", { d: targetPath, fill: "none", strokeWidth: strokeWidth, strokeLinecap: "round",
|
|
108
108
|
// Constant stroke width through the scaleY rise (no squash).
|
|
109
|
-
vectorEffect: "non-scaling-stroke", className: cn("transition-all duration-
|
|
109
|
+
vectorEffect: "non-scaling-stroke", className: cn("transition-all duration-[var(--motion-duration-base)]", appliedColorClass), stroke: customColor, filter: "url(#line-shadow)" })] }, shouldReduceMotion ? "line-static" : dataSignature), showDots &&
|
|
110
110
|
data.map((item, dataIndex) => {
|
|
111
111
|
const rawValue = item[key];
|
|
112
112
|
const isNull = rawValue === null || rawValue === undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChartDataPoint, ChartConfig, CurveType } from '../types/chart.types';
|
|
2
2
|
import type { ChartScales } from '../hooks/useChartScales';
|
|
3
3
|
import type { ChartDimensions, ChartMargins } from './ComboChartCanvas.types';
|
|
4
|
-
import type { MultiSeriesData } from '
|
|
4
|
+
import type { MultiSeriesData } from '../../core/shared/ChartTooltip';
|
|
5
5
|
export interface LineRendererProps {
|
|
6
6
|
/**
|
|
7
7
|
* Chart data
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
const donutChartTheme = {
|
|
5
5
|
// Base container styles
|
|
6
|
-
baseStyle: "relative flex items-center justify-center transition-all duration-
|
|
6
|
+
baseStyle: "relative flex items-center justify-center transition-all duration-[var(--motion-duration-slow)] cursor-default",
|
|
7
7
|
// Background track styling
|
|
8
8
|
track: "text-[var(--color-border)]",
|
|
9
9
|
// Progress arc styling
|
|
10
|
-
progress: "text-[var(--color-primary)] transition-all duration-
|
|
10
|
+
progress: "text-[var(--color-primary)] transition-all duration-[var(--motion-duration-slow)]",
|
|
11
11
|
// Text styling
|
|
12
12
|
text: {
|
|
13
|
-
label: "text-xl font-bold text-[var(--color-text-primary)] transition-colors duration-
|
|
14
|
-
subtitle: "text-sm text-[var(--color-text-secondary)] mt-1 transition-colors duration-
|
|
13
|
+
label: "text-xl font-bold text-[var(--color-text-primary)] transition-colors duration-[var(--motion-duration-slow)] tracking-tight",
|
|
14
|
+
subtitle: "text-sm text-[var(--color-text-secondary)] mt-1 transition-colors duration-[var(--motion-duration-slow)]",
|
|
15
15
|
},
|
|
16
16
|
// Default color palette (CSS variables for dark mode support)
|
|
17
17
|
// Note: These are resolved at runtime via getComputedStyle
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
const multiSegmentDonutChartTheme = {
|
|
5
5
|
// Base container styles
|
|
6
|
-
baseStyle: "relative flex items-center justify-center transition-all duration-
|
|
6
|
+
baseStyle: "relative flex items-center justify-center transition-all duration-[var(--motion-duration-slow)]",
|
|
7
7
|
// Background track styling
|
|
8
8
|
track: "text-[var(--color-border)]",
|
|
9
9
|
// Legend styling
|
|
@@ -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
|
}
|