@flikk/ui 1.0.0-beta.27 → 1.0.0-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bg/1.webp +0 -0
- package/dist/bg/10.webp +0 -0
- package/dist/bg/11.webp +0 -0
- package/dist/bg/12.webp +0 -0
- package/dist/bg/13.webp +0 -0
- package/dist/bg/14.webp +0 -0
- package/dist/bg/15.webp +0 -0
- package/dist/bg/16.webp +0 -0
- package/dist/bg/17.webp +0 -0
- package/dist/bg/18.webp +0 -0
- package/dist/bg/19.webp +0 -0
- package/dist/bg/2.webp +0 -0
- package/dist/bg/20.webp +0 -0
- package/dist/bg/21.webp +0 -0
- package/dist/bg/22.webp +0 -0
- package/dist/bg/3.webp +0 -0
- package/dist/bg/4.webp +0 -0
- package/dist/bg/5.webp +0 -0
- package/dist/bg/6.webp +0 -0
- package/dist/bg/7.webp +0 -0
- package/dist/bg/8.webp +0 -0
- package/dist/bg/9.webp +0 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +7 -143
- package/dist/components/ai/PromptInput/VoiceRecorder.js +0 -88
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/canvas/Background.d.ts +19 -0
- package/dist/components/canvas/Background.js +23 -0
- package/dist/components/canvas/BaseNode.d.ts +15 -0
- package/dist/components/canvas/BaseNode.js +20 -0
- package/dist/components/canvas/CanvasToolbar.d.ts +34 -0
- package/dist/components/canvas/CanvasToolbar.js +34 -0
- package/dist/components/canvas/Edge.d.ts +35 -0
- package/dist/components/canvas/Edge.js +97 -0
- package/dist/components/canvas/EdgeLayer.d.ts +18 -0
- package/dist/components/canvas/EdgeLayer.js +111 -0
- package/dist/components/canvas/Handle.d.ts +11 -0
- package/dist/components/canvas/Handle.js +63 -0
- package/dist/components/canvas/MiniMap.d.ts +22 -0
- package/dist/components/canvas/MiniMap.js +105 -0
- package/dist/components/canvas/NodeCanvas.d.ts +10 -0
- package/dist/components/canvas/NodeCanvas.js +477 -0
- package/dist/components/canvas/NodeCanvas.theme.d.ts +7 -0
- package/dist/components/canvas/NodeCanvas.theme.js +9 -0
- package/dist/components/canvas/NodeCanvas.types.d.ts +187 -0
- package/dist/components/canvas/NodeControls.d.ts +25 -0
- package/dist/components/canvas/NodeControls.js +40 -0
- package/dist/components/canvas/NodeRenderer.d.ts +19 -0
- package/dist/components/canvas/NodeRenderer.js +117 -0
- package/dist/components/canvas/changes.d.ts +11 -0
- package/dist/components/canvas/changes.js +76 -0
- package/dist/components/canvas/context/CanvasContext.d.ts +32 -0
- package/dist/components/canvas/context/CanvasContext.js +14 -0
- package/dist/components/canvas/context/ConnectionContext.d.ts +33 -0
- package/dist/components/canvas/context/ConnectionContext.js +13 -0
- package/dist/components/canvas/context/HandleRegistry.d.ts +24 -0
- package/dist/components/canvas/context/HandleRegistry.js +15 -0
- package/dist/components/canvas/context/InteractionContext.d.ts +18 -0
- package/dist/components/canvas/context/InteractionContext.js +14 -0
- package/dist/components/canvas/context/NodeIdContext.d.ts +3 -0
- package/dist/components/canvas/context/NodeIdContext.js +15 -0
- package/dist/components/canvas/hooks/useConnection.d.ts +17 -0
- package/dist/components/canvas/hooks/useConnection.js +29 -0
- package/dist/components/canvas/hooks/useMarquee.d.ts +25 -0
- package/dist/components/canvas/hooks/useMarquee.js +91 -0
- package/dist/components/canvas/hooks/useNodeDrag.d.ts +23 -0
- package/dist/components/canvas/hooks/useNodeDrag.js +110 -0
- package/dist/components/canvas/hooks/usePanZoom.d.ts +30 -0
- package/dist/components/canvas/hooks/usePanZoom.js +189 -0
- package/dist/components/canvas/hooks/useViewport.d.ts +21 -0
- package/dist/components/canvas/hooks/useViewport.js +35 -0
- package/dist/components/canvas/index.d.ts +14 -0
- package/dist/components/canvas/index.js +12 -0
- package/dist/components/canvas/layout.d.ts +22 -0
- package/dist/components/canvas/layout.js +67 -0
- package/dist/components/canvas/utils.d.ts +4 -0
- package/dist/components/canvas/utils.js +16 -0
- package/dist/components/charts/AreaChart/AreaChart.js +136 -101
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +5 -5
- package/dist/components/charts/AreaChart/AreaChart.types.js +1 -0
- package/dist/components/charts/BarChart/BarChart.js +207 -143
- package/dist/components/charts/BarChart/BarChart.types.d.ts +4 -4
- package/dist/components/charts/BarChart/BarChart.types.js +1 -0
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +2 -2
- package/dist/components/charts/LineChart/LineChart.js +88 -72
- package/dist/components/charts/LineChart/LineChart.types.d.ts +3 -3
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.theme.js +5 -2
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +62 -72
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +10 -1
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +3 -9
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +33 -33
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +2 -2
- package/dist/components/charts/hooks/index.d.ts +2 -0
- package/dist/components/charts/hooks/useChartDimensions.d.ts +29 -0
- package/dist/components/charts/hooks/useChartDimensions.js +42 -0
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +1 -1
- package/dist/components/charts/types/chart.types.d.ts +11 -2
- package/dist/components/charts/types/chart.types.js +10 -3
- package/dist/components/core/Avatar/Avatar.js +5 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +5 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +4 -2
- package/dist/components/core/Badge/Badge.js +1 -1
- package/dist/components/core/Badge/Badge.theme.js +16 -15
- package/dist/components/core/Button/Button.js +1 -1
- package/dist/components/core/Button/Button.theme.js +2 -2
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- package/dist/components/core/Card/Card.js +7 -3
- package/dist/components/core/Card/Card.theme.js +3 -3
- package/dist/components/core/Card/Card.types.d.ts +27 -2
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuItem.js +1 -1
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +1 -1
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -3
- package/dist/components/core/Dropdown/DropdownMenu.js +57 -29
- package/dist/components/core/HeroCard/HeroCard.d.ts +5 -0
- package/dist/components/core/HeroCard/HeroCard.js +99 -0
- package/dist/components/core/HeroCard/HeroCard.theme.d.ts +3 -0
- package/dist/components/core/HeroCard/HeroCard.theme.js +8 -0
- package/dist/components/core/HeroCard/HeroCard.types.d.ts +70 -0
- package/dist/components/core/HeroCard/index.d.ts +4 -0
- package/dist/components/core/Kbd/Kbd.theme.js +1 -1
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +2 -7
- package/dist/components/core/Modal/Modal.theme.js +4 -8
- package/dist/components/core/Modal/Modal.types.d.ts +0 -10
- package/dist/components/core/Modal/index.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStack.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStack.types.d.ts +1 -2
- package/dist/components/core/ModalStack/ModalStackModal.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStackModal.js +2 -7
- package/dist/components/core/PageHeading/PageHeading.theme.js +2 -2
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.js +242 -4
- package/dist/components/core/ScrollArea/ScrollArea.types.d.ts +12 -1
- package/dist/components/core/ScrollArea/smooth/SmoothScrollEngine.d.ts +4 -0
- package/dist/components/core/ScrollArea/smooth/SmoothScrollEngine.js +23 -0
- package/dist/components/core/ScrollArea/smooth/useSmoothScroll.js +4 -0
- package/dist/components/core/ScrollArea/smooth/useSmoothScroll.types.d.ts +5 -0
- package/dist/components/core/Segmented/Segmented.theme.js +2 -2
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.js +2 -0
- package/dist/components/data-display/DescriptionList/DescriptionList.js +23 -7
- package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +10 -3
- package/dist/components/data-display/DescriptionList/DescriptionList.types.d.ts +49 -10
- package/dist/components/data-display/DescriptionList/index.d.ts +1 -1
- package/dist/components/data-display/Feed/Feed.js +28 -5
- package/dist/components/data-display/Feed/Feed.theme.js +1 -1
- package/dist/components/data-display/Feed/Feed.types.d.ts +32 -1
- package/dist/components/data-display/Feed/index.d.ts +1 -1
- package/dist/components/data-display/Metric/Metric.js +8 -8
- package/dist/components/data-display/Metric/Metric.theme.d.ts +3 -2
- package/dist/components/data-display/Metric/Metric.theme.js +50 -68
- package/dist/components/data-display/Metric/Metric.types.d.ts +19 -21
- package/dist/components/data-display/Table/Table.js +2 -2
- package/dist/components/data-display/Table/Table.theme.js +24 -4
- package/dist/components/data-display/Table/Table.types.d.ts +8 -0
- package/dist/components/data-display/Table/TableBody.js +2 -2
- package/dist/components/data-display/Table/TableCell.js +1 -1
- package/dist/components/data-display/Table/TableRow.d.ts +1 -1
- package/dist/components/data-display/Table/TableRow.js +9 -2
- package/dist/components/data-display/Timeline/Timeline.js +27 -5
- package/dist/components/data-display/Timeline/Timeline.theme.d.ts +10 -2
- package/dist/components/data-display/Timeline/Timeline.theme.js +14 -8
- package/dist/components/data-display/Timeline/Timeline.types.d.ts +48 -16
- package/dist/components/data-display/Timeline/Timeline.utils.d.ts +6 -0
- package/dist/components/data-display/Timeline/Timeline.utils.js +11 -0
- package/dist/components/data-display/Timeline/TimelineItem.js +13 -20
- package/dist/components/data-display/Timeline/TimelineMarker.js +10 -8
- package/dist/components/data-display/Timeline/index.d.ts +2 -2
- package/dist/components/effects/3d/index.d.ts +0 -2
- package/dist/components/effects/3d/index.js +0 -1
- package/dist/components/effects/DotPattern/DotPattern.js +1 -1
- package/dist/components/effects/Overlay/Overlay.theme.js +1 -2
- package/dist/components/effects/Preloader/Preloader.animations.d.ts +23 -0
- package/dist/components/effects/Preloader/Preloader.animations.js +150 -0
- package/dist/components/effects/Preloader/Preloader.d.ts +3 -0
- package/dist/components/effects/Preloader/Preloader.js +119 -0
- package/dist/components/effects/Preloader/Preloader.types.d.ts +63 -0
- package/dist/components/effects/Preloader/index.d.ts +2 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +25 -14
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +2 -0
- package/dist/components/effects/TiltCard/TiltCard.d.ts +12 -0
- package/dist/components/effects/TiltCard/TiltCard.glow.d.ts +28 -0
- package/dist/components/effects/TiltCard/TiltCard.glow.js +114 -0
- package/dist/components/effects/TiltCard/TiltCard.js +177 -0
- package/dist/components/effects/{SpotlightBorder/SpotlightBorder.shaders.d.ts → TiltCard/TiltCard.shaders.d.ts} +1 -1
- package/dist/components/effects/{SpotlightBorder/SpotlightBorder.shaders.js → TiltCard/TiltCard.shaders.js} +1 -1
- package/dist/components/effects/TiltCard/TiltCard.types.d.ts +88 -0
- package/dist/components/effects/TiltCard/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +4 -12
- package/dist/components/effects/index.js +2 -6
- package/dist/components/forms/Checkbox/Checkbox.js +7 -1
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.js +1 -89
- package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +2 -2
- package/dist/components/forms/Slider/Slider.theme.js +1 -1
- package/dist/components/forms/Switch/Switch.js +27 -15
- package/dist/components/forms/Switch/Switch.theme.d.ts +36 -6
- package/dist/components/forms/Switch/Switch.theme.js +33 -4
- package/dist/components/forms/Switch/Switch.types.d.ts +12 -2
- package/dist/components/forms/TimePicker/TimePicker.theme.js +1 -2
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -90
- package/dist/components/forms/forms.theme.js +1 -1
- package/dist/components/forms/index.d.ts +0 -4
- package/dist/components/forms/index.js +0 -92
- package/dist/components/generative/GenerativeView.d.ts +21 -0
- package/dist/components/generative/GenerativeView.js +116 -0
- package/dist/components/generative/actions.d.ts +26 -0
- package/dist/components/generative/actions.js +51 -0
- package/dist/components/generative/index.d.ts +11 -0
- package/dist/components/generative/index.js +9 -0
- package/dist/components/generative/registry.d.ts +43 -0
- package/dist/components/generative/registry.js +114 -0
- package/dist/components/generative/resolvers.d.ts +35 -0
- package/dist/components/generative/resolvers.js +93 -0
- package/dist/components/generative/schema.generated.d.ts +2 -0
- package/dist/components/generative/schema.generated.js +1639 -0
- package/dist/components/generative/schemaTypes.d.ts +30 -0
- package/dist/components/generative/streaming.d.ts +39 -0
- package/dist/components/generative/streaming.js +283 -0
- package/dist/components/generative/tools.d.ts +21 -0
- package/dist/components/generative/tools.js +54 -0
- package/dist/components/generative/types.d.ts +41 -0
- package/dist/components/generative/useGenerativeStream.d.ts +37 -0
- package/dist/components/generative/useGenerativeStream.js +36 -0
- package/dist/components/generative/validate.d.ts +24 -0
- package/dist/components/generative/validate.js +259 -0
- package/dist/components/layout/AppShell/AppShell.theme.js +2 -2
- package/dist/components/layout/FormLayout/FormLayout.js +1 -90
- package/dist/components/layout/Grid/Grid.d.ts +3 -0
- package/dist/components/layout/Grid/Grid.js +50 -0
- package/dist/components/layout/Grid/Grid.theme.d.ts +2 -0
- package/dist/components/layout/Grid/Grid.theme.js +35 -0
- package/dist/components/layout/Grid/Grid.types.d.ts +57 -0
- package/dist/components/layout/Grid/index.d.ts +3 -0
- package/dist/components/layout/Section/Section.d.ts +3 -0
- package/dist/components/layout/Section/Section.js +18 -0
- package/dist/components/layout/Section/Section.theme.d.ts +2 -0
- package/dist/components/layout/Section/Section.theme.js +10 -0
- package/dist/components/layout/Section/Section.types.d.ts +34 -0
- package/dist/components/layout/Section/index.d.ts +3 -0
- package/dist/components/layout/Stack/Stack.d.ts +3 -0
- package/dist/components/layout/Stack/Stack.js +19 -0
- package/dist/components/layout/Stack/Stack.theme.d.ts +2 -0
- package/dist/components/layout/Stack/Stack.theme.js +10 -0
- package/dist/components/layout/Stack/Stack.types.d.ts +39 -0
- package/dist/components/layout/Stack/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/generative.schema.json +1637 -0
- package/dist/index.js +180 -180
- package/dist/registry.json +648 -464
- package/dist/styles.css +1 -1
- package/dist/tools.json +1731 -0
- package/package.json +17 -4
- package/src/global.scss +53 -101
- package/src/styles/theme.css +687 -493
- package/dist/bg/1.jpg +0 -0
- package/dist/bg/10.jpg +0 -0
- package/dist/bg/11.jpg +0 -0
- package/dist/bg/14.jpg +0 -0
- package/dist/bg/15.jpg +0 -0
- package/dist/bg/16.jpg +0 -0
- package/dist/bg/17.jpg +0 -0
- package/dist/bg/18.jpg +0 -0
- package/dist/bg/19.jpg +0 -0
- package/dist/bg/2.jpg +0 -0
- package/dist/bg/20.jpg +0 -0
- package/dist/bg/21.jpg +0 -0
- package/dist/bg/22.jpg +0 -0
- package/dist/bg/23.jpg +0 -0
- package/dist/bg/24.jpg +0 -0
- package/dist/bg/3.jpg +0 -0
- package/dist/bg/4.jpg +0 -0
- package/dist/bg/5.jpg +0 -0
- package/dist/bg/6.jpg +0 -0
- package/dist/bg/7.jpg +0 -0
- package/dist/bg/8.jpg +0 -0
- package/dist/bg/9.jpg +0 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +0 -17
- package/dist/components/effects/MorphingText/MorphingText.js +0 -125
- package/dist/components/effects/MorphingText/MorphingText.types.d.ts +0 -18
- package/dist/components/effects/MorphingText/index.d.ts +0 -2
- package/dist/components/effects/PageTransition/PageTransition.animations.d.ts +0 -8
- package/dist/components/effects/PageTransition/PageTransition.animations.js +0 -53
- package/dist/components/effects/PageTransition/PageTransition.d.ts +0 -3
- package/dist/components/effects/PageTransition/PageTransition.js +0 -82
- package/dist/components/effects/PageTransition/PageTransition.types.d.ts +0 -15
- package/dist/components/effects/PageTransition/index.d.ts +0 -2
- package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +0 -26
- package/dist/components/effects/ParallaxSection/ParallaxSection.js +0 -71
- package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +0 -11
- package/dist/components/effects/ParallaxSection/index.d.ts +0 -2
- package/dist/components/effects/Spotlight/Spotlight.d.ts +0 -36
- package/dist/components/effects/Spotlight/Spotlight.js +0 -112
- package/dist/components/effects/Spotlight/Spotlight.types.d.ts +0 -29
- package/dist/components/effects/Spotlight/index.d.ts +0 -2
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.d.ts +0 -18
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.js +0 -213
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.types.d.ts +0 -61
- package/dist/components/effects/SpotlightBorder/index.d.ts +0 -2
- package/dist/components/effects/StickyScroll/StickyScroll.d.ts +0 -30
- package/dist/components/effects/StickyScroll/StickyScroll.js +0 -128
- package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +0 -19
- package/dist/components/effects/StickyScroll/index.d.ts +0 -2
- package/dist/components/forms/CronInput/CronInput.d.ts +0 -3
- package/dist/components/forms/CronInput/CronInput.js +0 -113
- package/dist/components/forms/CronInput/CronInput.theme.d.ts +0 -6
- package/dist/components/forms/CronInput/CronInput.theme.js +0 -75
- package/dist/components/forms/CronInput/CronInput.types.d.ts +0 -109
- package/dist/components/forms/CronInput/CronInput.utils.d.ts +0 -67
- package/dist/components/forms/CronInput/CronInput.utils.js +0 -505
- package/dist/components/forms/CronInput/index.d.ts +0 -4
- /package/dist/components/effects/{SpotlightBorder/SpotlightBorder.types.js → TiltCard/TiltCard.types.js} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useRef,
|
|
3
|
-
import { motion } from 'motion/react';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { useRef, useId, useMemo, useState, useCallback } from 'react';
|
|
3
|
+
import { useReducedMotion, motion, AnimatePresence } from 'motion/react';
|
|
4
4
|
import { cn } from '../../../utils/cn.js';
|
|
5
5
|
import { useTooltipPosition } from '../hooks/useTooltipPosition.js';
|
|
6
6
|
import { useChartAccessibility } from '../hooks/useChartAccessibility.js';
|
|
7
|
+
import { useChartDimensions } from '../hooks/useChartDimensions.js';
|
|
7
8
|
import { XAxis } from '../shared/ChartAxis/XAxis.js';
|
|
8
9
|
import { YAxis } from '../shared/ChartAxis/YAxis.js';
|
|
9
10
|
import { HorizontalGrid } from '../shared/ChartGrid/HorizontalGrid.js';
|
|
@@ -13,8 +14,10 @@ import { ChartCrosshair } from '../shared/ChartCrosshair/ChartCrosshair.js';
|
|
|
13
14
|
import { generateNiceTicks } from '../utils/chart-validation.js';
|
|
14
15
|
import { generateCurvePath } from '../utils/path-utils.js';
|
|
15
16
|
import { AREA_CHART_DEFAULTS } from './AreaChart.types.js';
|
|
17
|
+
import { X_AXIS_MARGIN } from '../types/chart.types.js';
|
|
16
18
|
import { areaChartTheme, getSeriesFillColor, getSeriesColorClass } from './AreaChart.theme.js';
|
|
17
19
|
|
|
20
|
+
const sanitizeSvgId = (value) => value.replace(/[^a-zA-Z0-9_-]/g, "");
|
|
18
21
|
const AreaChart = ({ data, config,
|
|
19
22
|
// Standardized display props with defaults
|
|
20
23
|
showGrid = AREA_CHART_DEFAULTS.showGrid, showXAxis = AREA_CHART_DEFAULTS.showXAxis, showYAxis = AREA_CHART_DEFAULTS.showYAxis, minValue: propMinValue, maxValue: propMaxValue, variant = AREA_CHART_DEFAULTS.variant, theme,
|
|
@@ -24,10 +27,22 @@ strokeWidth = AREA_CHART_DEFAULTS.strokeWidth, curved = AREA_CHART_DEFAULTS.curv
|
|
|
24
27
|
// Base props
|
|
25
28
|
className, title, description, enableKeyboardNavigation = AREA_CHART_DEFAULTS.enableKeyboardNavigation,
|
|
26
29
|
// Additional className overrides for chart elements
|
|
27
|
-
svgClassName, areaClassName, lineClassName, gridClassName, axisClassName, children, ...props }) => {
|
|
30
|
+
svgClassName, areaClassName, lineClassName, gridClassName, axisClassName, width, height, children, ...props }) => {
|
|
28
31
|
var _a;
|
|
29
32
|
// Resolve dotRadius with backward compatibility
|
|
30
33
|
const resolvedDotRadius = (_a = dotRadius !== null && dotRadius !== void 0 ? dotRadius : radius) !== null && _a !== void 0 ? _a : AREA_CHART_DEFAULTS.dotRadius;
|
|
34
|
+
const resolveColor = (color, fallback) => {
|
|
35
|
+
if (!color)
|
|
36
|
+
return fallback;
|
|
37
|
+
if (!color.startsWith("var(") &&
|
|
38
|
+
!color.startsWith("#") &&
|
|
39
|
+
!color.startsWith("rgb") &&
|
|
40
|
+
!color.startsWith("hsl") &&
|
|
41
|
+
color.includes("-")) {
|
|
42
|
+
return `var(--color-${color})`;
|
|
43
|
+
}
|
|
44
|
+
return color;
|
|
45
|
+
};
|
|
31
46
|
// Development warning for deprecated radius prop
|
|
32
47
|
if (process.env.NODE_ENV !== "production" && radius !== undefined) {
|
|
33
48
|
console.warn("[AreaChart]: The `radius` prop is deprecated and will be removed in a future version. " +
|
|
@@ -35,11 +50,27 @@ svgClassName, areaClassName, lineClassName, gridClassName, axisClassName, childr
|
|
|
35
50
|
}
|
|
36
51
|
// Simplified color system - no complex theme hook needed
|
|
37
52
|
const containerRef = useRef(null);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
const
|
|
53
|
+
// `measured` gates the rise + dots so motion captures the baseline scaleY
|
|
54
|
+
// origin and dot positions at the real size, not the 600×400 fallback.
|
|
55
|
+
const { dimensions, measured } = useChartDimensions(containerRef);
|
|
56
|
+
const chartId = sanitizeSvgId(useId());
|
|
57
|
+
const clipId = `${chartId}-clip`;
|
|
58
|
+
const shadowFilterId = `${chartId}-shadow`;
|
|
59
|
+
const isGradientVariant = variant === "gradient";
|
|
60
|
+
const getAreaGradientId = (index) => `${chartId}-area-gradient-${index}`;
|
|
61
|
+
const getLineGlowId = (index) => `${chartId}-line-glow-${index}`;
|
|
62
|
+
const getMarkerGlowId = (index) => `${chartId}-marker-glow-${index}`;
|
|
63
|
+
// The gradient look caps the line weight so the glow stays crisp
|
|
64
|
+
const gradientStrokeWidth = Math.min(strokeWidth, 1);
|
|
42
65
|
const ANIMATION_DURATION = 1.5;
|
|
66
|
+
// Entrance: the line/area RISES from the x-axis (scaleY 0→1 about the
|
|
67
|
+
// baseline), mirroring how BarChart's bars grow up from the zero line. A
|
|
68
|
+
// single continuous path can't morph between datasets of different point
|
|
69
|
+
// counts, so it rises rather than draws. Keying the series group on the data
|
|
70
|
+
// signature replays the rise on every range switch; reduced-motion users get
|
|
71
|
+
// a stable key + scaleY:1 (no animation).
|
|
72
|
+
const shouldReduceMotion = useReducedMotion();
|
|
73
|
+
const dataSignature = useMemo(() => JSON.stringify(data), [data]);
|
|
43
74
|
const [hoveredPoint, setHoveredPoint] = useState(null);
|
|
44
75
|
// Detect if device is mobile/touch
|
|
45
76
|
const isMobile = typeof window !== "undefined" &&
|
|
@@ -58,26 +89,6 @@ svgClassName, areaClassName, lineClassName, gridClassName, axisClassName, childr
|
|
|
58
89
|
description,
|
|
59
90
|
enableKeyboardNavigation,
|
|
60
91
|
});
|
|
61
|
-
// Measure container dimensions
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
const updateDimensions = () => {
|
|
64
|
-
if (containerRef.current) {
|
|
65
|
-
const { width, height } = containerRef.current.getBoundingClientRect();
|
|
66
|
-
setDimensions({
|
|
67
|
-
width: width || 600,
|
|
68
|
-
height: height || 400,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
updateDimensions();
|
|
73
|
-
const resizeObserver = new ResizeObserver(updateDimensions);
|
|
74
|
-
if (containerRef.current) {
|
|
75
|
-
resizeObserver.observe(containerRef.current);
|
|
76
|
-
}
|
|
77
|
-
return () => {
|
|
78
|
-
resizeObserver.disconnect();
|
|
79
|
-
};
|
|
80
|
-
}, []);
|
|
81
92
|
// Early return if no data
|
|
82
93
|
if (!data || data.length === 0) {
|
|
83
94
|
return (jsx("div", { className: cn(areaChartTheme.emptyStateStyle, className), role: "img", "aria-label": "Empty area chart", ...props, children: jsx("span", { children: "No data available" }) }));
|
|
@@ -86,11 +97,12 @@ svgClassName, areaClassName, lineClassName, gridClassName, axisClassName, childr
|
|
|
86
97
|
const margin = useMemo(() => ({
|
|
87
98
|
top: 0,
|
|
88
99
|
right: 0,
|
|
89
|
-
bottom: showXAxis ?
|
|
100
|
+
bottom: showXAxis ? X_AXIS_MARGIN : 0,
|
|
90
101
|
left: showYAxis ? 60 : 0,
|
|
91
102
|
}), [showXAxis, showYAxis]);
|
|
92
103
|
const innerWidth = dimensions.width - margin.left - margin.right;
|
|
93
104
|
const innerHeight = dimensions.height - margin.top - margin.bottom;
|
|
105
|
+
const gradientAreaGap = 4;
|
|
94
106
|
// Get all data keys from config
|
|
95
107
|
const dataKeys = useMemo(() => Object.keys(config), [config]);
|
|
96
108
|
// Calculate scales
|
|
@@ -205,21 +217,24 @@ svgClassName, areaClassName, lineClassName, gridClassName, axisClassName, childr
|
|
|
205
217
|
});
|
|
206
218
|
return result;
|
|
207
219
|
}, [data, dataKeys, stacked, stackedValues, curved, curveType, getPointPosition]);
|
|
208
|
-
return (jsxs("div", { ref: containerRef, className: cn(areaChartTheme.containerStyle, className),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
return (jsxs("div", { ref: containerRef, className: cn(areaChartTheme.containerStyle, className), style: {
|
|
221
|
+
width: width !== undefined ? (typeof width === "number" ? `${width}px` : width) : undefined,
|
|
222
|
+
height: height !== undefined ? (typeof height === "number" ? `${height}px` : height) : undefined,
|
|
223
|
+
}, ...chartAccessibilityProps, onMouseEnter: handleMouseInteraction, onMouseMove: handleMouseInteraction, onMouseLeave: () => {
|
|
224
|
+
// Clear the crosshair + glow marker when the pointer leaves the chart.
|
|
225
|
+
// The per-point rects only hide the tooltip; nothing else resets this.
|
|
226
|
+
setHoveredPoint(null);
|
|
227
|
+
handleMouseLeave();
|
|
228
|
+
}, ...props, children: [descriptionProps && jsx("div", { ...descriptionProps }), jsxs("svg", { width: "100%", height: "100%", viewBox: `0 0 ${dimensions.width} ${dimensions.height}`, className: cn(areaChartTheme.svgStyle, svgClassName), role: "presentation", children: [jsxs("defs", { children: [jsx("filter", { id: shadowFilterId, x: "-20%", y: "-20%", width: "140%", height: "140%", children: jsx("feDropShadow", { dx: "4", dy: "4", stdDeviation: "6", floodOpacity: "0.1", floodColor: "#000000" }) }), jsx("clipPath", { id: clipId, children: jsx("rect", { x: margin.left, y: margin.top, width: innerWidth, height: innerHeight }) }), dataKeys.map((key, keyIndex) => {
|
|
229
|
+
var _a;
|
|
230
|
+
const fillColor = resolveColor((_a = config[key]) === null || _a === void 0 ? void 0 : _a.color, getSeriesFillColor(keyIndex));
|
|
231
|
+
return (jsx("linearGradient", { id: getAreaGradientId(keyIndex), gradientUnits: isGradientVariant ? "objectBoundingBox" : undefined, x1: "0", y1: "0", x2: "0", y2: "1", children: isGradientVariant ? (jsxs(Fragment, { children: [jsx("stop", { offset: "0%", stopColor: fillColor, stopOpacity: Math.min(0.42, fillOpacity * 1.15) }), jsx("stop", { offset: "32%", stopColor: fillColor, stopOpacity: Math.min(0.24, fillOpacity * 0.68) }), jsx("stop", { offset: "78%", stopColor: fillColor, stopOpacity: Math.min(0.08, fillOpacity * 0.22) }), jsx("stop", { offset: "100%", stopColor: fillColor, stopOpacity: "0" })] })) : (jsxs(Fragment, { children: [jsx("stop", { offset: "0%", stopColor: fillColor, stopOpacity: fillOpacity * 0.8 }), jsx("stop", { offset: "100%", stopColor: fillColor, stopOpacity: fillOpacity * 0.05 })] })) }, `gradient-${key}`));
|
|
232
|
+
}), isGradientVariant &&
|
|
233
|
+
dataKeys.map((key, keyIndex) => {
|
|
234
|
+
var _a;
|
|
235
|
+
const fillColor = resolveColor((_a = config[key]) === null || _a === void 0 ? void 0 : _a.color, getSeriesFillColor(keyIndex));
|
|
236
|
+
return (jsxs(React__default.Fragment, { children: [jsx("filter", { id: getLineGlowId(keyIndex), x: "-12%", y: "-35%", width: "124%", height: "170%", colorInterpolationFilters: "sRGB", children: jsx("feDropShadow", { dx: "0", dy: "0", stdDeviation: "5", floodColor: fillColor, floodOpacity: "0.42" }) }), jsx("filter", { id: getMarkerGlowId(keyIndex), x: "-120%", y: "-120%", width: "340%", height: "340%", colorInterpolationFilters: "sRGB", children: jsx("feDropShadow", { dx: "0", dy: "0", stdDeviation: "5", floodColor: fillColor, floodOpacity: "0.45" }) })] }, `gradient-filters-${key}`));
|
|
237
|
+
}), jsxs("linearGradient", { id: "vertical-fade", x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [jsx("stop", { offset: "0%", stopColor: "#6b7280", stopOpacity: "0" }), jsx("stop", { offset: "40%", stopColor: "#6b7280", stopOpacity: "0.3" }), jsx("stop", { offset: "50%", stopColor: "#6b7280", stopOpacity: "0.5" }), jsx("stop", { offset: "60%", stopColor: "#6b7280", stopOpacity: "0.3" }), jsx("stop", { offset: "100%", stopColor: "#6b7280", stopOpacity: "0" })] }), jsxs("linearGradient", { id: "horizontal-fade", x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [jsx("stop", { offset: "0%", stopColor: "#6b7280", stopOpacity: "0" }), jsx("stop", { offset: "40%", stopColor: "#6b7280", stopOpacity: "0.3" }), jsx("stop", { offset: "50%", stopColor: "#6b7280", stopOpacity: "0.5" }), jsx("stop", { offset: "60%", stopColor: "#6b7280", stopOpacity: "0.3" }), jsx("stop", { offset: "100%", stopColor: "#6b7280", stopOpacity: "0" })] })] }), jsx(HorizontalGrid, { show: showGrid, x: margin.left, y: margin.top, width: innerWidth, height: innerHeight, lineCount: 5, className: gridClassName }), jsx(ChartCrosshair, { show: hoveredPoint !== null, x: hoveredPoint !== null
|
|
223
238
|
? data.length === 1
|
|
224
239
|
? margin.left + innerWidth / 2
|
|
225
240
|
: margin.left +
|
|
@@ -235,67 +250,87 @@ svgClassName, areaClassName, lineClassName, gridClassName, axisClassName, childr
|
|
|
235
250
|
((numValue - minValue) / (maxValue - minValue)) *
|
|
236
251
|
innerHeight);
|
|
237
252
|
})()
|
|
238
|
-
: undefined, margin: margin, innerWidth: innerWidth, innerHeight: innerHeight, showHorizontal: dataKeys.length === 1 }), jsx(YAxis, { show: showYAxis, min: minValue, max: maxValue, x: margin.left, y: margin.top, height: innerHeight, showGrid: false, gridWidth: innerWidth, className: axisClassName, tickFormatter: (value) => {
|
|
253
|
+
: undefined, margin: margin, innerWidth: innerWidth, innerHeight: innerHeight, showHorizontal: dataKeys.length === 1, strokeColor: isGradientVariant ? getSeriesFillColor(0) : undefined, strokeWidth: isGradientVariant ? 1.5 : undefined, strokeDasharray: isGradientVariant ? "3 7" : undefined, opacity: isGradientVariant ? 0.28 : undefined }), jsx(YAxis, { show: showYAxis, min: minValue, max: maxValue, x: margin.left, y: margin.top, height: innerHeight, showGrid: false, gridWidth: innerWidth, className: axisClassName, tickFormatter: (value) => {
|
|
239
254
|
if (Math.abs(value) >= 1000)
|
|
240
255
|
return `${(value / 1000).toFixed(0)}k`;
|
|
241
256
|
return value.toString();
|
|
242
|
-
} }), minValue < 0 && maxValue > 0 && (jsx("line", { x1: margin.left, y1: margin.top + innerHeight - ((0 - minValue) / (maxValue - minValue)) * innerHeight, x2: margin.left + innerWidth, y2: margin.top + innerHeight - ((0 - minValue) / (maxValue - minValue)) * innerHeight, className: "stroke-[var(--color-text-secondary)]", strokeWidth: 1, opacity: 0.6 })), jsx("g", { className: cn(areaChartTheme.areaGroupStyle, areaClassName), clipPath: `url(#${clipId})`, children:
|
|
243
|
-
|
|
257
|
+
} }), minValue < 0 && maxValue > 0 && (jsx("line", { x1: margin.left, y1: margin.top + innerHeight - ((0 - minValue) / (maxValue - minValue)) * innerHeight, x2: margin.left + innerWidth, y2: margin.top + innerHeight - ((0 - minValue) / (maxValue - minValue)) * innerHeight, className: "stroke-[var(--color-text-secondary)]", strokeWidth: 1, opacity: 0.6 })), jsx("g", { className: cn(areaChartTheme.areaGroupStyle, areaClassName), clipPath: `url(#${clipId})`, children: measured &&
|
|
258
|
+
dataKeys.map((key, keyIndex) => {
|
|
259
|
+
var _a, _b, _c, _d, _e;
|
|
260
|
+
const paths = allPaths[key];
|
|
261
|
+
const colorClass = getSeriesColorClass(keyIndex);
|
|
262
|
+
if (!paths)
|
|
263
|
+
return null;
|
|
264
|
+
return (jsxs(motion.g, { initial: { scaleY: shouldReduceMotion ? 1 : 0 }, animate: { scaleY: 1 }, transition: { duration: ANIMATION_DURATION, ease: "easeOut" },
|
|
265
|
+
// Rise from the x-axis like the bars. Framer forces
|
|
266
|
+
// transform-box:fill-box for SVG (a view-box origin is ignored),
|
|
267
|
+
// so `originY:1` anchors scaleY to the group's fill-box BOTTOM.
|
|
268
|
+
// The invisible rect below pins that bottom to the plot baseline,
|
|
269
|
+
// so the series grows UP from the x-axis — not from its own mid-height.
|
|
270
|
+
style: { originY: 1, transformOrigin: "bottom" }, 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-200", filter: isGradientVariant ? undefined : `url(#${shadowFilterId})`, transform: isGradientVariant
|
|
271
|
+
? `translate(0 ${gradientAreaGap})`
|
|
272
|
+
: undefined }), showStroke && (jsxs(Fragment, { children: [isGradientVariant && (jsx(motion.path, { d: paths.linePath, initial: { opacity: 1 }, animate: { opacity: 1 }, fill: "none", stroke: resolveColor((_a = config[key]) === null || _a === void 0 ? void 0 : _a.color, getSeriesFillColor(keyIndex)), strokeWidth: gradientStrokeWidth + 1, strokeLinecap: "round", strokeLinejoin: "round",
|
|
273
|
+
// Stroke width must ignore the group's scaleY rise, else
|
|
274
|
+
// it squashes flat at the start of the animation.
|
|
275
|
+
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: ((_b = config[key]) === null || _b === void 0 ? void 0 : _b.color) ? resolveColor((_c = config[key]) === null || _c === void 0 ? void 0 : _c.color, "") : (isGradientVariant ? getSeriesFillColor(keyIndex) : undefined), strokeWidth: isGradientVariant ? gradientStrokeWidth : strokeWidth, strokeLinecap: "round", strokeLinejoin: "round",
|
|
276
|
+
// Constant stroke width through the scaleY rise (no squash).
|
|
277
|
+
vectorEffect: "non-scaling-stroke", className: cn("transition-colors duration-200", !isGradientVariant &&
|
|
278
|
+
(colorClass
|
|
279
|
+
.split(" ")
|
|
280
|
+
.find((cls) => cls.startsWith("stroke-")) || ""), lineClassName), style: { stroke: ((_d = config[key]) === null || _d === void 0 ? void 0 : _d.color) ? resolveColor((_e = config[key]) === null || _e === void 0 ? void 0 : _e.color, "") : undefined } })] }))] }, `${key}${shouldReduceMotion ? "" : `-${dataSignature}`}`));
|
|
281
|
+
}) }), showDots && (jsx("g", { className: "chart-dots", children: dataKeys.map((key, keyIndex) => {
|
|
244
282
|
const colorClass = getSeriesColorClass(keyIndex);
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const colorClass = getSeriesColorClass(keyIndex);
|
|
297
|
-
return (jsx(ChartMarker, { cx: x, cy: y, radius: resolvedDotRadius, colorClass: colorClass }, `hover-${key}-${hoveredPoint.index}`));
|
|
298
|
-
}) })), jsx("g", { className: "chart-hover-areas", children: data.map((item, dataIndex) => {
|
|
283
|
+
return (jsx("g", { children: data.map((item, dataIndex) => {
|
|
284
|
+
var _a, _b;
|
|
285
|
+
const rawValue = item[key];
|
|
286
|
+
const isNull = rawValue === null || rawValue === undefined;
|
|
287
|
+
// Don't render dots for null values
|
|
288
|
+
if (isNull)
|
|
289
|
+
return null;
|
|
290
|
+
const value = typeof rawValue === "number" ? rawValue : 0;
|
|
291
|
+
const topValue = stacked && stackedValues[key]
|
|
292
|
+
? stackedValues[key][dataIndex] + value
|
|
293
|
+
: value;
|
|
294
|
+
const { x, y } = getPointPosition(dataIndex, topValue);
|
|
295
|
+
return (jsx(motion.g, { initial: { opacity: 0, scale: 0 }, animate: { opacity: 1, scale: 1 }, transition: {
|
|
296
|
+
// Markers pop in one-by-one (left-to-right) only AFTER the
|
|
297
|
+
// line has fully risen — start the stagger at the rise's end.
|
|
298
|
+
delay: shouldReduceMotion ? 0 : ANIMATION_DURATION + dataIndex * 0.06,
|
|
299
|
+
type: "spring",
|
|
300
|
+
stiffness: 260,
|
|
301
|
+
damping: 20,
|
|
302
|
+
}, style: {
|
|
303
|
+
originX: "50%",
|
|
304
|
+
originY: "50%",
|
|
305
|
+
transformBox: "fill-box",
|
|
306
|
+
}, children: jsx(ChartMarker, { cx: x, cy: y, radius: resolvedDotRadius, colorClass: colorClass, strokeColor: ((_a = config[key]) === null || _a === void 0 ? void 0 : _a.color) ? resolveColor((_b = config[key]) === null || _b === void 0 ? void 0 : _b.color, "") : undefined }) }, `${key}-${dataIndex}${shouldReduceMotion ? "" : `-${dataSignature}`}`));
|
|
307
|
+
}) }, key));
|
|
308
|
+
}) })), jsx("g", { className: "chart-hover-markers", children: jsx(AnimatePresence, { children: (!showDots || isGradientVariant) &&
|
|
309
|
+
hoveredPoint !== null &&
|
|
310
|
+
dataKeys.map((key, keyIndex) => {
|
|
311
|
+
var _a, _b, _c;
|
|
312
|
+
const item = data[hoveredPoint.index];
|
|
313
|
+
const rawValue = item[key];
|
|
314
|
+
const isNull = rawValue === null || rawValue === undefined;
|
|
315
|
+
const value = isNull
|
|
316
|
+
? 0
|
|
317
|
+
: typeof rawValue === "number"
|
|
318
|
+
? rawValue
|
|
319
|
+
: 0;
|
|
320
|
+
// Don't render hover markers for null values
|
|
321
|
+
if (isNull)
|
|
322
|
+
return null;
|
|
323
|
+
const topValue = stacked && stackedValues[key]
|
|
324
|
+
? stackedValues[key][hoveredPoint.index] + value
|
|
325
|
+
: value;
|
|
326
|
+
const { x, y } = getPointPosition(hoveredPoint.index, topValue);
|
|
327
|
+
const colorClass = getSeriesColorClass(keyIndex);
|
|
328
|
+
const markerColor = resolveColor((_a = config[key]) === null || _a === void 0 ? void 0 : _a.color, getSeriesFillColor(keyIndex));
|
|
329
|
+
if (isGradientVariant) {
|
|
330
|
+
return (jsxs(motion.g, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.22, ease: "easeOut" }, filter: `url(#${getMarkerGlowId(keyIndex)})`, style: { pointerEvents: "none" }, children: [jsx("circle", { cx: x, cy: y, r: resolvedDotRadius + 9, fill: markerColor, opacity: 0.12 }), jsx("circle", { cx: x, cy: y, r: resolvedDotRadius + 4, fill: "white", stroke: markerColor, strokeWidth: 2.5 }), jsx("circle", { cx: x, cy: y, r: resolvedDotRadius, fill: markerColor })] }, `hover-${key}-${hoveredPoint.index}`));
|
|
331
|
+
}
|
|
332
|
+
return (jsx(ChartMarker, { cx: x, cy: y, radius: resolvedDotRadius, colorClass: colorClass, strokeColor: ((_b = config[key]) === null || _b === void 0 ? void 0 : _b.color) ? resolveColor((_c = config[key]) === null || _c === void 0 ? void 0 : _c.color, "") : undefined }, `hover-${key}-${hoveredPoint.index}`));
|
|
333
|
+
}) }) }), jsx("g", { className: "chart-hover-areas", children: data.map((item, dataIndex) => {
|
|
299
334
|
// Calculate hover area based on new point positioning
|
|
300
335
|
const pointX = data.length === 1
|
|
301
336
|
? margin.left + innerWidth / 2
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseChartProps, StandardChartDisplayProps, StandardVisualProps } from '../types/chart.types';
|
|
1
|
+
import { BaseChartProps, StandardChartDisplayProps, StandardVisualProps, ChartVariant } from '../types/chart.types';
|
|
2
2
|
export interface AreaChartProps extends BaseChartProps, StandardChartDisplayProps, StandardVisualProps {
|
|
3
3
|
dotRadius?: number;
|
|
4
4
|
radius?: number;
|
|
@@ -15,12 +15,13 @@ export interface AreaChartProps extends BaseChartProps, StandardChartDisplayProp
|
|
|
15
15
|
axisClassName?: string;
|
|
16
16
|
}
|
|
17
17
|
export declare const AREA_CHART_DEFAULTS: {
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
18
|
+
readonly variant: ChartVariant;
|
|
19
|
+
readonly dotRadius: 3;
|
|
20
|
+
readonly radius: 3;
|
|
20
21
|
readonly strokeWidth: 2;
|
|
21
22
|
readonly curved: true;
|
|
22
23
|
readonly curveType: import("..").CurveType;
|
|
23
|
-
readonly showDots:
|
|
24
|
+
readonly showDots: false;
|
|
24
25
|
readonly fillOpacity: 0.3;
|
|
25
26
|
readonly showStroke: true;
|
|
26
27
|
readonly stacked: false;
|
|
@@ -32,7 +33,6 @@ export declare const AREA_CHART_DEFAULTS: {
|
|
|
32
33
|
readonly gap: 4;
|
|
33
34
|
readonly categoryGap: 16;
|
|
34
35
|
readonly orientation: "vertical" | "horizontal";
|
|
35
|
-
readonly variant: import("..").ChartVariant;
|
|
36
36
|
readonly enableKeyboardNavigation: true;
|
|
37
37
|
};
|
|
38
38
|
export type AreaChartData = BaseChartProps['data'][0];
|
|
@@ -3,6 +3,7 @@ import { CHART_DEFAULTS } from '../types/chart.types.js';
|
|
|
3
3
|
// Default values using centralized defaults
|
|
4
4
|
const AREA_CHART_DEFAULTS = {
|
|
5
5
|
...CHART_DEFAULTS,
|
|
6
|
+
variant: "gradient", // AreaChart defaults to the gradient (premium) look; use variant="default" for flat fills
|
|
6
7
|
dotRadius: CHART_DEFAULTS.dotRadius, // 20 - For dot markers
|
|
7
8
|
radius: CHART_DEFAULTS.dotRadius, // @deprecated - kept for backward compatibility
|
|
8
9
|
strokeWidth: CHART_DEFAULTS.strokeWidth,
|